![CentOS 7.6 - yum 更新错误“无法找到存储库的有效基本 URL:addons/7”](https://linux22.com/image/144898/CentOS%207.6%20-%20yum%20%E6%9B%B4%E6%96%B0%E9%94%99%E8%AF%AF%E2%80%9C%E6%97%A0%E6%B3%95%E6%89%BE%E5%88%B0%E5%AD%98%E5%82%A8%E5%BA%93%E7%9A%84%E6%9C%89%E6%95%88%E5%9F%BA%E6%9C%AC%20URL%EF%BC%9Aaddons%2F7%E2%80%9D.png)
当我尝试这样做时yum update
,我收到以下错误消息。
Loaded plugins: fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch= error was
14: curl#7 - "Failed to connect to 2001:4178:5:200::10: Network is unreachable
Cannot find a valid baseurl for repo: addons/7
我该如何修复它?
答案1
对于那些遇到类似问题的人,我通过以下步骤解决了问题。
前往
/etc/sysconfig/network-scripts/ifcfg-enp0s3
并更改ONBOOT=yes
将 http 添加到防火墙
firewall-cmd --permanent --zone=public --add-service=http
重新启动防火墙
firewall-cmd --reload
重新启动网络
service network restart
然后问题就消失了。