服务器之家

专注于服务器技术!
当前位置:首页 > 服务器系统 > Linux

CentOS yum update出错的解决办法

发布时间:2014-08-03 来源:服务器之家

刚安装完的centos 6.2系统发现yum仓库更新不了。提示报错信息:

[root@linuxso.com ~]# yum update

Loaded plugins: aliases, changelog, downloadonly, fastestmirror, kabi, presto, security, tmprepo, verify, versionlock

Loading support for CentOS kernel ABI

Determining fastest mirrors

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.163.com/centos/6.2/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.163.com'"

Trying other mirror.

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

[root@linuxso.com ~]# service iptables stop

[root@linuxso.com ~]# nslookup  mirrorlist.centos.org

;; connection timed out; no servers could be reached

到这里发现问题了,我的域名解析不了,yum的配置文件里指向的域名就识别不了了。重新设置下dns指向。

[root@linuxso.com ~]# vim /etc/resolv.conf

# Generated by NetworkManager

search 38forsbm

nameserver 8.8.8.8

[root@linuxso.com ~]# yum update –y   --更新可以使用。