解决CentOS-Media.repo 文件导致yum失败方法
八月 12, 2010 by admin · Leave a Comment
默认就是需要修改nameserver才能yum的,但是namesever已经修改为google的 8.8.8.8,缺还仍然提示yum错误,
[root@itvps ~]# yum -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/yum.repos.d/[root@itvps yum.repos.d]# lsCentOS-Base.repo CentOS-Media.repo[root@itvps yum.repos.d]#[root@itvps ~]# yum -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/yum.repos.d/[root@itvps yum.repos.d]# lsCentOS-Base.repo CentOS-Media.repo[root@itvps yum.repos.d]#
网上查询了一下,这个是yum更新源的问题,
解决的方法是:将 /etc/yum.repos.d/CentOS-Media.repo 文件删除
如果还不行的话,那还要修改一下/etc/yum.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