运行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了

转载于:https://www.cnblogs.com/yecao8888/p/6985070.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值