運行yum update出現一下錯誤信息


運行yum update出現一下錯誤信息:

# yum update

Loaded plugins: fastestmirror, security

Loading mirror speeds from cached hostfile

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=addons error was

14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"

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'"

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=extras error was

14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=updates error was

14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"

http://mirrors.sohu.com/centos/6/addons/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.sohu.com'"

Trying other mirror.

Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons. Please verify its path and try again

 

 

直接修改/etc/resolv.conf不行。必須要在/etc /sysconfig/network-scripts/ifcfg-eth0里

重新設置服務ip地址比如以下我服務器的配置

DEVICE=eth0
TYPE=Ethernet
UUID=dda8decf-b147-4ad9-805f-3d8e5ef82d9d
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=172.18.5.250        #########服務IP地址
GATEWAY=172.18.5.254     #########默認網關
NETMASK=255.255.255.0    #########子網掩碼
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
HWADDR=00:0C:29:E1:56:CD
PEERDNS=yes
PEERROUTES=yes

這樣設置后,/etc/resolv.conf里面根本就不需要設置。service network restart

就可以使用yum了


免責聲明!

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



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