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

关注微信公众号“虾米聊吧”,每天更新一篇技术文章,文章内容涵盖架构师成长必经之路应掌握的技术,一起学习,一起交流。

 

最近在安装mysql的rpm包时,出现了一个问题,

当使用命令:rpm -i Mysql-server-xxxx.rpm时出现以下错误:

 

error:Failed dependencies:

                               ld-linux.so.2 is needed by MySql-server-xxx

                              libc.so.6 is needed by MySql-server-xxx

                              libc.so.6(GLIBC_2.0) is needed by MySql-server-xxx

                              ...............................................................................................

 

如上,很明显缺少相关的依赖包,于是使用yum命令安装相关的依赖

使用命令:yum install ld-linux.so.2

又出错了,错误如下:

 

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 8.8.8.8

如果没有vi编辑器可用:

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

然后ping www.baidu.com

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

 

ok,安装依赖,

yum install ld-linux.so.2

最后出现compelete即可

 

关注微信公众号“虾米聊吧”,获取更多知识资料干货~,一起交流,一起学习~,

一起打卡学习,一起交流进步吧!

微信扫描二维码,关注我的公众号

你可能感兴趣的:(linux)