我恢复了一台旧的 HP Proliant ML110 G5 服务器。我格式化了磁盘并重新安装了操作系统 CentOS 5.11。当我尝试安装某些程序或执行其他操作时,我经常收到以下错误:
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
例如,当我尝试升级好吃通过命令行我得到了这个结果:
[root@localhost ~]# yum upgrade
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/repo/arch combination/
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/repo/arch combination/
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/repo/arch combination/
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/repo/arch combination/
* c5-media:
http://mirror.centos.org/centos/5/os/x86_64/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
我尝试了通过 Google 找到的几种解决方案,但仍然无法解决这个问题。
答案1
http://mirror.centos.org/centos/5/os/x86_64/repodata/repomd.xml:[Errno 14] HTTP 错误 404:未找到
CentOS 5.11 已于三年前结束生命周期。该仓库已移至“旧版本”库。请用/etc/yum.repos
以下内容替换其中的文件CentOS-5.11.repo
:
[CentOS 5.11]
name=CentOS-5.11-x86_64
baseurl=http://vault.centos.org/5.11/os/x86_64/
enabled=1
gpgcheck=1
[CentOS 5.11-updates]
name=CentOS-5.11-updates-x86_64
baseurl=http://vault.centos.org/5.11/updates/x86_64/
enabled=1
gpgcheck=1
[epel-5.11.repo]
name=CentOS-5.11-EPEL
baseurl=https://archives.fedoraproject.org/pub/archive/epel/5/x86_64/
enabled=1
gpgcheck=1