解决CenOS yum安装出现Could not retrieve mirrorlist

当yum -y install XXXX 出现如下问题:

2
3
4
5
6
7
8
9
Loaded plugins : fastestmirror , refresh - packagekit , security
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http : //mirrorlist.centos.org/?release=6&arch=i386&repo=os error was
14 : PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
Error : Cannot find a valid baseurl for repo : base
[ root @ chenyi yum . repos . d ] # vi CentOS-Base.repo
[ root @ chenyi yum . repos . d ] # yum install rrdtool-*
Loaded plugins : fastestmirror , refresh - packagekit , security
Loading mirror speeds from cached hostfile

原因:没有配置/etc/resolv.conf


解决方法:
到/etc目录下配置resolv.conf加入nameserver IP,如:
保存再次运行上面命令就可以。

更加详细:http://www.itchenyi.com/2382.html

你可能感兴趣的:(error,yum安装,cenos)