解决CentOS-Media.repo 文件导致yum失败方法

八月 12, 2010 by admin · Leave a Comment 

默认就是需要修改nameserver才能的,但是namesever已经修改为google的 8.8.8.8,缺还仍然提示错误,

[root@itvps ~]# -y install file
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: anorien.csc.warwick.ac.uk
* updates: centos.bio.lmu.de
* addons: anorien.csc.warwick.ac.uk
* extras: anorien.csc.warwick.ac.uk
http://anorien.csc.warwick.ac.uk/mirrors/centos/5.3/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://ftp.heanet.ie/pub/centos/5.3/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://mirror.as29550.net/mirror.centos.org/5.3/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://mirror.bytemark.co.uk/centos/5.3/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://mirror.sov.uk.goscomb.net/centos/5.3/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://mirror.ukhost4u.com/centos/5.3/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://mirrors.dedipower.com/centos/5.3/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://mirrors.nl.kernel.org/centos/5.3/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://mirrors.ukfast.co.uk/sites/ftp.centos.org/5.3/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://www.mirrorservice.org/sites/mirror.centos.org/5.3/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
[root@itvps ~]# cd /etc/.repos.d/
[root@itvps .repos.d]# ls
CentOS-Base.repo  CentOS-Media.repo
[root@itvps .repos.d]#

[root@itvps ~]# -y install fileLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: anorien.csc.warwick.ac.uk * updates: centos.bio.lmu.de * addons: anorien.csc.warwick.ac.uk * extras: anorien.csc.warwick.ac.ukhttp://anorien.csc.warwick.ac.uk/mirrors/centos/5.3/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not FoundTrying other mirror.http://ftp.heanet.ie/pub/centos/5.3/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not FoundTrying other mirror.http://mirror.as29550.net/mirror.centos.org/5.3/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not FoundTrying other mirror.http://mirror.bytemark.co.uk/centos/5.3/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not FoundTrying other mirror.http://mirror.sov.uk.goscomb.net/centos/5.3/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not FoundTrying other mirror.http://mirror.ukhost4u.com/centos/5.3/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not FoundTrying other mirror.http://mirrors.dedipower.com/centos/5.3/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not FoundTrying other mirror.http://mirrors.nl.kernel.org/centos/5.3/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not FoundTrying other mirror.http://mirrors.ukfast.co.uk/sites/ftp.centos.org/5.3/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not FoundTrying other mirror.http://www.mirrorservice.org/sites/mirror.centos.org/5.3/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not FoundTrying other mirror.Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again[root@itvps ~]# cd /etc/.repos.d/[root@itvps .repos.d]# lsCentOS-Base.repo  CentOS-Media.repo[root@itvps .repos.d]#

网上查询了一下,这个是更新源的问题,
解决的方法是:将 /etc/.repos.d/CentOS-Media.repo 文件删除
如果还不行的话,那还要修改一下/etc/.repos.d/CentOS-Base.repo文件,将内容修改成这样:

#

#

[base]

name=CentOS-$releasever – Base

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os

#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#released updates

[updates]

name=CentOS-$releasever – Updates

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates

#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#packages used/produced in the build but not released

[addons]

name=CentOS-$releasever – Addons

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons

#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful

[extras]

name=CentOS-$releasever – Extras

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras

#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-$releasever – Plus

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus

#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/

gpgcheck=1

enabled=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#contrib – packages by Centos Users

[contrib]

name=CentOS-$releasever – Contrib

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib

#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/

gpgcheck=1

enabled=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

这回再次运行,已经能够顺利进行了!
类似这样的情况应该很少见到,这个也是我首次碰到,希望以后如果有人碰到了能够方便解决.

About admin

注意:

1、本站启用了审核机制,你的留言可能稍后才会显示,请不要重复提交,谢谢。
2、留言时的头像是Gravatar提供的服务。想设置的看这里
3、评论者允许使用'@user空格'的方式将自己的评论通知另外评论者。

To submit your comment, click the image below where it asks you to... Clickcha - The One-click Captcha