解決Linux下yum安裝無法解析URL的問題


問題:

[root@yaya ~]# 
yum -y install gcc-*
Loaded plugins: fastestmirror, presto
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 retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

 

原因:
 dns服務器沒有配置正確

 

解決辦法:
1、打開文件/etc/resolv.conf在其中添加:

 nameserver 8.8.8.8
 nameserver 8.8.4.4

 

 

2、然后重啟網卡:使用命令:

service network restart

問題解決


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM