今天我得到了这个奇怪的错误,我无法修复它:
root@server# yum -y update Loaded plugins: allowdowngrade YumRepo Error: All mirror URLs are not using ftp, http[s] or file. Eg. </html>/ removing mirrorlist with no valid mirrors: /var/cache/yum/addons/mirrorlist.txt Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons. Please verify its path and try again root@server#
与禁用回购“插件”:
root@server# yum update --disablerepo=addons Loaded plugins: allowdowngrade YumRepo Error: All mirror URLs are not using ftp, http[s] or file. Eg. </html>/ removing mirrorlist with no valid mirrors: /var/cache/yum/base/mirrorlist.txt Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again root@server#
用“yum clean all”:
root@server# yum clean all Loaded plugins: allowdowngrade Cleaning up Everything root@server# yum -y update Loaded plugins: allowdowngrade YumRepo Error: All mirror URLs are not using ftp, http[s] or file. Eg. </html>/ removing mirrorlist with no valid mirrors: /var/cache/yum/addons/mirrorlist.txt Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons. Please verify its path and try again root@server#
编辑22-09-2011:rpm –verify centos-release yum
root@server# rpm --verify centos-release yum ..5....T c /etc/issue ..5....T c /etc/issue.net S.5....T c /etc/yum.repos.d/CentOS-Base.repo missing c /etc/yum.repos.d/CentOS-Debuginfo.repo S.5....T c /etc/yum.repos.d/CentOS-Vault.repo package yum is not installed root@server#
我该如何解决这个问题?
“无法检索存储库元数据”错误看起来像一个红鲱鱼。 真正的错误似乎是这样的:
YumRepo Error: All mirror URLs are not using ftp, http[s] or file. Eg. </html>/
你的Yum回购文件损坏了吗?
/etc/yum.conf和/etc/yum.repos.d/*.repo中的文件由yum和centos-release软件包提供(用rpm -q --whatprovides /etc/yum.conf /etc/yum.repos.d/*testing – rpm -q --whatprovides /etc/yum.conf /etc/yum.repos.d/* )。
尝试validationRPM文件在/etc/yum.repos.d/中的文件。 有没有变化?
在下面的例子中,文件CentOS-Base.repo已被本地修改:
% rpm --verify centos-release yum S.5....T c /etc/yum.repos.d/CentOS-Base.repo
如果您发现这些文件确实发生了变化,那么您可以尝试重新安装rpms ,或者只提取所需的几个文件,然后手动将其移动到位。 先备份旧文件,稍后再进行调查。
尝试一个yum clean all然后重试你最初的yum -y update
好像你的服务器要么拉空镜像列表,要么不能连接镜像列表服务器。 首先检查你的服务器是否真的在使用镜像列表,
lynx http://mirrorlist.centos.org/?release=5&arch=i386&repo=addons lynx http://mirrorlist.centos.org/?release=5&arch=i386&repo=os
如果您正在获取空白页面,则很可能是镜像closures或列表为空。 您可以禁用镜像,并可以使用baseurl中的直接centos镜像。 为此,注释掉/etc/yum.repos.d/CentOS-Base.repo中的镜像列表 ,并确保在已经评论的情况下取消对baseurl的注释。