解决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