【问题标题】:yum update on cent OS in a restricted network在受限网络中在 centOS 上进行 yum 更新
【发布时间】:2018-11-30 02:51:41
【问题描述】:

我有一种情况,我从 iso 映像在我的 VM 上安装了 CentOS 7.5。我的服务器没有通过互联网连接。现在,我想从 centOS 站点更新软件包,但是当我执行 yum update 时,它失败并出现以下错误 -

Error- https://mirror.centos.org/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 
14] curl#7 - "Failed to connect to 2a00:1768:1001:48::10: Network is     unreachable"
Trying other mirror.

我已在防火墙规则中添加了 mirror.centos.org 的 IP。但问题是每次我尝试执行 nslookup 时 IP 都会不断变化。

[root@763729-mars-oms-docker-registry yum.repos.d]# curl -v https://mirror.centos.org
* About to connect() to mirror.centos.org port 443 (#0)
*   Trying 185.50.225.30...
* Connection refused
*   Trying 2a05:b80:0:118::10...
* Failed to connect to 2a05:b80:0:118::10: Network is unreachable
* Failed connect to mirror.centos.org:443; Network is unreachable
* Closing connection 0
curl: (7) Failed to connect to 2a05:b80:0:118::10: Network is unreachable
[root@763729-mars-oms-docker-registry yum.repos.d]# nslookup mirror.centos.org
Server:         83.138.151.80
Address:        83.138.151.80#53

Non-authoritative answer:
Name:   mirror.centos.org
Address: 195.154.220.72

[root@763729-mars-oms-docker-registry yum.repos.d]# nslookup mirror.centos.org
Server:         83.138.151.80
Address:        83.138.151.80#53

Non-authoritative answer:
Name:   mirror.centos.org
Address: 77.247.178.5

[root@763729-mars-oms-docker-registry yum.repos.d]# curl -v https://mirror.centos.org
* About to connect() to mirror.centos.org port 443 (#0)
*   Trying 109.228.54.129...
* Connection refused
*   Trying 2a02:2658:1056:0:222:19ff:fed6:7c9a...
* Failed to connect to 2a02:2658:1056:0:222:19ff:fed6:7c9a: Network is unreachable
* Failed connect to mirror.centos.org:443; Network is unreachable
* Closing connection 0
curl: (7) Failed to connect to 2a02:2658:1056:0:222:19ff:fed6:7c9a: Network is unreachable

由于防火墙规则不由我们管理,如果要执行任何更改,我们必须要求我们的云提供商每次执行更改。因此,我们要求为此 url 实现动态 ACL。但是他们需要一些时间来实施,因为他们在我们的时区之外工作,所以我必须等待第二天。

但是,cent OS 镜像存储库是否有静态 IP,我可以参考并添加一次以解决此问题。或者有什么其他建议?

【问题讨论】:

    标签: centos7 yum


    【解决方案1】:

    通过在 baseurl 中添加最近的镜像站点并替换 mirror.centos.org 解决了这个问题。并在防火墙规则中添加镜像站点IP。

    【讨论】:

      猜你喜欢
      • 2020-07-03
      • 1970-01-01
      • 2016-07-30
      • 2012-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-02
      相关资源
      最近更新 更多