利用yum -y update更新包时遇到以下问题。
[root@iZ28q7v0rnhZ mysql]# yum -y update
Loaded plugins: security
Setting up Update Process
Could not retrieve mirrorlist http://apt.sw.be/redhat/el5/en/mirrors-rpmforge error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'apt.sw.be'"
http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'apt.sw.be'"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: rpmforge. Please verify its path and try again
这是由于yum默认源apt.sw.be源出现了问题,解决方法为:
打开目录 /etc/yum.repos.d/,将其中的文件rpmforge.repo备份掉。
[root@iZ28q7v0rnhZ yum.repos.d]# ls
backup CentOS-Media.repo mirrors-rpmforge rpmforge.repo
CentOS-Base.repo CentOS-Vault.repo mirrors-rpmforge-extras
CentOS-Debuginfo.repo epel.repo mirrors-rpmforge-testing
[root@iZ28q7v0rnhZ yum.repos.d]# mv rpmforge.repo rpmforge.repo.bak
然后可以正常进行yum下载更新。