在受限网络中对%OS的yum更新

时间:2018-11-23 13:07:56

标签: centos7 yum

我遇到从iso映像在VM上安装了CentOS 7.5的情况。我的服务器未通过Internet连接。现在,我想从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

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

但是,有一个用于cent OS镜像存储库的静态IP,我可以引用该静态IP并将其添加一次以解决此问题。或其他建议?

1 个答案:

答案 0 :(得分:0)

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