当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 notretrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=i386&repo=os error was
14:PYCURL ERROR6-"Couldn't resolve host 'mirrorlist.centos.org'"
Error:Cannot findavalid baseurl forrepo: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