新装CentOS系统,使用yum命令时报错:
0 1 2 3 4 5 |
# yum -y install wget Loaded plugins: fastestmirror Determining fastest mirrors Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was 14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'" Error: Cannot find a valid baseurl for repo: base |
解决方法:
0 |
# vi /etc/resolv.conf |
打开文件后,在最末尾另起一行,加入如下内容,保存文件即可。
0 |
nameserver 8.8.8.8 |
完成。测试>>
0 |
# yum list |