Yum出错Error: Cannot find a valid baseurl for repo: addons

centos yum 错误 Error: Cannot find a valid baseurl for repo: addons 装了个CentOS 5.x,使用yum时出现了下面的错误提示。
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=5&arch=i386&repo=addons error was
[Errno 4] IOError: <urlopen error (-3, ‘Temporary failure in name resolution’)>
Error: Cannot find a valid baseurl for repo: addons
然后 ping mirrorlist.centos.org 发现ping不通。怀疑是dns设置问题。 ping www.ctohome.com 也出现  unknown host www.ctohome.com 的错误。多试一试偶尔会ping通,说明dns的确有问题。于是,我们来修改dns配置:
echo “nameserver 8.8.8.8″ >> /etc/resolv.conf
再次yum,成功。

你可能感兴趣的:(职场,yum,休闲,yum出错)