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即可

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...