无法使用 EPEL 存储库,出现 NSS 错误 -5990 (PR_IO_TIMEOUT_ERROR)

无法使用 EPEL 存储库,出现 NSS 错误 -5990 (PR_IO_TIMEOUT_ERROR)

我正在使用 vagrant 启动 centOS 7.0 虚拟机。我的配置者正在尝试通过以下方式设置 EPEL 7

yum install epel-release -y

然后尝试通过安装ansible

yum install ansible -y

它成功安装了 epel-release,但是当尝试执行进一步的 yum 命令时,我开始看到:

 One of the configured repositories failed (Unknown),
 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 <repoid>

     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=<repoid>.skip_if_unavailable=true

Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again

以下是一些调试步骤:

yum --disablerepo="epel"  check-update

工作得很好。所以我尝试了

URLGRABBER_DEBUG=1 yum check-update 2> debug.log

在 debug.log 的末尾,我看到了实际的错误:

< HTTP/1.1 200 Connection established
< 
2015-03-30 20:54:18,080 header ended:
* Proxy replied OK to CONNECT request
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* NSS error -5990 (PR_IO_TIMEOUT_ERROR)
* I/O operation timed out
* Closing connection 10
2015-03-30 20:54:48,110 exception: [Errno 14] curl#35 - "I/O operation timed out"
2015-03-30 20:54:48,110 retrycode (14) not in list [-1, 2, 4, 5, 6, 7], re-raising

我对如何解决这个问题有点迷失。请注意,有时这会起作用,但 95% 的情况下,尝试获取 EPEL 存储库元数据会失败。这是我这边的问题吗?我正在通过代理进行路由,但代理似乎工作正常。我认为最令人困惑的部分是它很少起作用。

答案1

在我们的例子中,这是一个防火墙问题...我们允许主机出站 http(端口 80)访问,但不允许 https(443)访问。常规存储库通过前者访问,但 EPEL 存储库通过后者访问。因此,循环中没有 EPEL 时,“yum 更新”(或其他任何内容)工作正常,但使用 EPEL 时,它会爆炸,

==> 配置的存储库之一失败(未知)...

噗。现在我们知道了!

答案2

当您在没有互联网连接的情况下请求 yum 获取存储库时,会出现此问题。您已经安装了 epel 版本。但没有互联网连接来安装ansible。

resolve.conf在下面评论了我的喜欢并尝试了。我遇到了同样的错误。

[root@controller yum.repos.d]# cat /etc/resolv.conf
# Generated by NetworkManager
#nameserver 8.8.8.8

[root@controller yum.repos.d]#

[root@controller yum.repos.d]# yum install ansible -y
Loaded plugins: fastestmirror


 One of the configured repositories failed (Unknown),
 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 <repoid>

     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=<repoid>.skip_if_unavailable=true

Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again

这是最新版本 Centos 7 的正常行为。

如果您从虚拟机访问互联网时遇到问题,请检查关联。

相关内容