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

問題:centos

[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服務器沒有配置正確服務器

 

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

 nameserver 8.8.8.8
 nameserver 8.8.4.4

 

 

二、而後重啓網卡:使用命令: rest

service network restart

問題解決code

相關文章
相關標籤/搜索