LoginSignup
29
33

More than 5 years have passed since last update.

CentOS 6.6 でyum update に失敗する

Last updated at Posted at 2016-02-12

何があったか?

メンテをサボっていた開発サーバーを久しぶりに使おうと起動をして
yum updateかけようとしたら失敗した

# yum update -y
読み込んだプラグイン:fastestmirror, presto
更新処理の設定をしています
Loading mirror speeds from cached hostfile
 * base: ftp.riken.jp
 * epel: ftp.riken.jp
 * extras: ftp.riken.jp
 * rpmforge: ftp.riken.jp
 * updates: ftp.riken.jp
http://ftp.riken.jp/Linux/centos/6.6/os/i386/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
他のミラーを試します。
http://ftp.iij.ad.jp/pub/linux/centos/6.6/os/i386/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
他のミラーを試します。
http://www.ftp.ne.jp/Linux/packages/CentOS/6.6/os/i386/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
他のミラーを試します。
http://ftp.jaist.ac.jp/pub/Linux/CentOS/6.6/os/i386/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
他のミラーを試します。
http://ftp.tsukuba.wide.ad.jp/Linux/centos/6.6/os/i386/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
他のミラーを試します。
http://ftp.nara.wide.ad.jp/pub/Linux/centos/6.6/os/i386/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
他のミラーを試します。
http://mirror.fairway.ne.jp/centos/6.6/os/i386/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
他のミラーを試します。
http://ftp.yz.yamagata-u.ac.jp/pub/linux/centos/6.6/os/i386/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
他のミラーを試します。
http://centos.usonyx.net/main/6.6/os/i386/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
他のミラーを試します。
http://mirror.nus.edu.sg/centos/6.6/os/i386/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
他のミラーを試します。
依存性の解決をしています

こんな感じ。
少し時間を無駄にしたので対策を残そうと思う。

原因

yumのリポジトリのミラーが古いバージョンのままになっている
旧:mirror.centos.org/centos
新:vault.centos.org

対策

yumのリポジトリを新しいミラー先を参照するように書き換える
$ sudo sed -i -e "s|mirror\.centos\.org/centos/\$releasever|vault\.centos\.org/6.6|g" /etc/yum.repos.d/CentOS-Base.repo
$ sudo sed -i -e "s|#baseurl=|baseurl=|g" /etc/yum.repos.d/CentOS-Base.repo
$ sudo sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-Base.repo

参照先のコマンドそのまんまですが。

updateかける

# yum update
読み込んだプラグイン:fastestmirror, presto
更新処理の設定をしています
Loading mirror speeds from cached hostfile
 * epel: ftp.riken.jp
 * rpmforge: ftp.riken.jp
base                                                                                                                                                     | 3.7 kB     00:00     
extras                                                                                                                                                   | 3.4 kB     00:00     
Not using downloaded repomd.xml because it is older than what we have:
  Current   : Thu Jan 14 00:20:37 2016
  Downloaded: Thu May 21 00:33:58 2015
updates                                                                                                                                                  | 3.4 kB     00:00     
Not using downloaded repomd.xml because it is older than what we have:
  Current   : Wed Feb 10 22:52:52 2016
  Downloaded: Tue Jul 21 04:09:24 2015
依存性の解決をしています

updateに失敗したがキャッシュのせいのようなので

yum clean all

もう一度

yum update

無事完了しましたとさ。

おしまい。

参照サイト

心配ならsedで書き換える前に念のためバックアップとっといたほうがいいですね!

29
33
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
29
33