yum出错Error: Cannot find a valid baseurl for repo: base

前端之家收集整理的这篇文章主要介绍了yum出错Error: Cannot find a valid baseurl for repo: base前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。



使用yum命令安装的时候出错:yum localinstall --nogpgcheck *.rpm

错误如下:

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

解决方法如下(修改dns配置)

vi /etc/resolv.conf

在此文件最后加入:nameserver xxx.xxx.xxx.xxx

如果没有vi编辑器可用:

echo "nameserver xxx.xxx.xxx.xxx" >>/etc/resolv.conf

然后pingwww.baidu.com

可以ping通,不会再出现unknow host

ok,安装依赖,

最后出现compelete即可

猜你在找的Bash相关文章