久しぶりに立ち上げたCentOSでyum updateがうまく動作しない時の対処法

2017年7月12日

サーバー テクノロジー トラブル 日記

サーバーって立ち上げっぱなしじゃないですか。 そして、サーバーに久々にログインすると、パスワードとかって忘れてたりするじゃないですか。 そうならないために、沢山サーバーを使っている場合は、みんな同じパスワードにするじゃないですか。 こうして、情報漏えいって起きるんだな・・・と考えながら、久々の自宅サーバーメンテナンスをしようと考えて、作業を開始した所、yum updateがうまく実行されない・・・orz まったく、今どきのサーバーもイケてないぜ・・・ そんな自分に無駄口を叩きながら、キーボードを叩き続けます。

環境

ここでは、下記のような環境で操作をしています。 $ cat /etc/redhat-release CentOS Linux release 7.2.1511 (AltArch) 今をときめくCentOSですね。 今までDebianなんか使っていたから、Repoがちゃんと理解出来ていないことは最初から分かっている事・・・

状況

$ yum update 読み込んだプラグイン:fastestmirror base | 3.6 kB 00:00:00 extras | 2.9 kB 00:00:00 http://nginx.org/packages/centos/7/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found 他のミラーを試します。 To address this issue please refer to the below knowledge base article https://access.redhat.com/articles/1320623 If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/ One of the configured repositories failed (nginx repo), and yum doesn't have enough cached data to continue. At this point the only safe thing yum can do is fail. There are a few ways to work "fix" this: 1. Contact the upstream for the repository and get them to fix the problem. 2. Reconfigure the baseurl/etc. for the repository, to point to a working upstream. This is most often useful if you are using a newer distribution release than is supported by the repository (and the packages for the previous distribution release still work). 3. Disable the repository, so yum won't use it by default. Yum will then just ignore the repository until you permanently enable it again or use --enablerepo for temporary usage: yum-config-manager --disable nginx 4. Configure the failing repository to be skipped, if it is unavailable. Note that yum will try to contact the repo. when it runs most commands, so will have to try and fail each time (and thus. yum will be be much slower). If it is a very temporary problem though, this is often a nice compromise: yum-config-manager --save --setopt=nginx.skip_if_unavailable=true failure: repodata/repomd.xml from nginx: [Errno 256] No more mirrors to try. http://nginx.org/packages/centos/7/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found nginxがうまく動作していないので、停止することを勧められている。 とりあえずは、書いてあるとおりにコマンドを叩いてみる

対応-1

エラー表示に書いてあるコマンドをそれぞれ実行してみる。 $ yum-config-manager --disable nginx -bash: yum-config-manager: コマンドが見つかりません $ yum-config-manager --save --setopt=nginx.skip_if_unavailable=true -bash: yum-config-manager: コマンドが見つかりません どれもうまくできない・・・

対応-2

repoのnginxが壊れているようなので、こいつを外してみたらどうだろう・ $ cd /etc/yum.repo.d $ mv nginx.repo nginx.repo.bak これで無事にupdateが出来るようになった・・・ そして、200MBぐらいのアップデートプログラムをダウンロードしたいと駄々をこねてきたの優しくYesと答えてあげた。 総ダウンロード容量: 212 M Is this ok [y/d/N]: y ...

作業を終えて一服・・・

あとはひたすら待つだけ・・・ インストール時にその場しのぎのrepoをセットするからこういう羽目になってしまうことをよく理解し、その場しのぎの対応を終えたいと思います。

人気の投稿

このブログを検索

ごあいさつ

このWebサイトは、独自思考で我が道を行くユゲタの少し尖った思考のTechブログです。 毎日興味がどんどん切り替わるので、テーマはマルチになっています。 もしかしたらアイデアに困っている人の助けになるかもしれません。

ブログ アーカイブ