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通,不會再出現unknow host
ok,安裝依賴,
yum install ld-linux.so.2
最後出現compelete即可