CentOS7 で yum update に失敗する備忘録

Server
Photo by hyt.

前記事

Hyper-V で CentOS7 が起動しない備忘録
久しぶりにテスト用クライアントの Hyper-V で1年ほど前の CentOS7 のイメージを復元してみると,何と! Failed to open \EFI\BOOT\grubx64.efi - Not Found Failed to lo...

の続きです.

症状

ちょっとした事情で1年度ほど前の CentOS7 の仮想マシンイメージを復元して,起動しなかったのをきちんと起動するように修復したのが前回の記事なのですが,今度は,

yum update としても,アップデートイメージが見つからない!

と怒られてしまいました.実際に見に行っているのは,

http://ftp.riken.jp/Linux/centos/7.2.1511/readme

です.そして,確かに,ここには以下の内容の readme ファイルしか無い.

This directory (and version of CentOS) is deprecated. For normal users,
you should use /7/ and not /7.2.1511/ in your path. Please see this FAQ
concerning the CentOS release scheme:

404 - Page not found

If you know what you are doing, and absolutely want to remain at the 7.2.1511
level, go to http://vault.centos.org/ for packages.

Please keep in mind that 7.2.1511 no longer gets any updates, nor
any security fix’s.

そのまま読むと,http://valt.centos.org に古いパッケージがあると書かれてはいるのですが,そのまえに,

you should use /7/ and not /7.2.1511/ in your path.

とも書いてある.と言うことで,/etc/yum.repos.d/CentOS-Base.repo を書き換えようかと思ったんですが,念のため,正常に動いているイメージの CentOS-Base.repo の内容と比較してみると全く同じ.う~ん,どうしたものかとしばらく悩んでいたのですが,解決策はとてもシンプルでした.

解決策

解決方法は,

$ sudo yum clean all

です.要するに何らかの原因で yum のキャッシュに接続先の情報が残ってしまっていたのいうことみたい.それを消してやれば普通に yum update できるようになりました.

以上!

Server
スポンサーリンク
Following hyt!
hyt adversaria
タイトルとURLをコピーしました