CentOS 資料一覧

yum実行時に「Cannot retrieve metalink for repository: epel.」というエラーが出る場合の対応(SSL接続エラー)

2014/11/06更新

対応バージョン: 6.4

yumコマンド実行時に以下のメッセージが出てコマンドが失敗する。

# yum update
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

デバッグモードで実行すると以下のようにSSLの接続でエラーになっている。

# URLGRABBER_DEBUG=1 yum check-update 2> /tmp/debug.log
# cat /tmp/debug.log
:
2014-11-06 19:27:00,026 attempt 1/10: https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=x86_64
INFO:urlgrabber:attempt 1/10: https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=x86_64
2014-11-06 19:27:00,026 opening local file "/var/cache/yum/x86_64/6/epel/metalink.xml.tmp" with mode wb
INFO:urlgrabber:opening local file "/var/cache/yum/x86_64/6/epel/metalink.xml.tmp" with mode wb
* About to connect() to mirrors.fedoraproject.org port 443 (#0)
*   Trying 2001:4178:2:1269::fed2... * 接続を拒否されました
*   Trying 2607:f188::dead:beef:cafe:fed1... * 接続を拒否されました
*   Trying 2610:28:3090:3001:dead:beef:cafe:fed4... * 接続を拒否されました
*   Trying 66.135.62.201... * connected
* Connected to mirrors.fedoraproject.org (66.135.62.201) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* NSS error -8092
* Closing connection #0
* SSL connect error
2014-11-06 19:27:00,898 exception: [Errno 14] problem making ssl connection
INFO:urlgrabber:exception: [Errno 14] problem making ssl connection
2014-11-06 19:27:00,898 retrycode (14) not in list [-1, 2, 4, 5, 6, 7], re-raising
INFO:urlgrabber:retrycode (14) not in list [-1, 2, 4, 5, 6, 7], re-raising
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

正常な場合は以下のようになる。

:
2014-11-06 19:28:48,858 attempt 1/None: file:///etc/yum.repos.d/virtualbox.repo
INFO:urlgrabber:attempt 1/None: file:///etc/yum.repos.d/virtualbox.repo
* Closing connection #0
2014-11-06 19:28:48,859 success
INFO:urlgrabber:success

このエラーが出る場合NSSのアップデートが必要なので以下のコマンドでアップデートする。

# yum --disablerepo=epel update nss

これで問題なくyumコマンドが実行できるようになる。

# yum update
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: www.ftp.ne.jp
 * epel: mirror.premi.st
 * extras: www.ftp.ne.jp
 * updates: www.ftp.ne.jp
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package ORBit2.x86_64 0:2.14.17-3.2.el6_3 will be updated
: