当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,如:
1
2
3
|
nameserver
8.8.8.8
nameserver 8.8.4.4 search localdomain |
保存再次运行上面命令就可以。
转载于:https://blog.51cto.com/smilezhuolin/1325165