I got this strange error today and I'm not able to fix it:
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#
with disabled repo "addons":
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#
with "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#
edit 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#
How can I fix this issue ?
Try a
yum clean all
and retry your initialyum -y update
Seems like your server is either pulling the empty mirror list or cannot connect to the mirror list server. First check whether your server is actually pulling the mirror list using,
If you are getting empty page, most likely the mirrors are down or the list is empty. You can disable mirrors and can use the direct centos mirror in the baseurl. For this, comment out mirrorlist in /etc/yum.repos.d/CentOS-Base.repo and make sure to uncomment baseurl if it is already commented.
The "Cannot retrieve repository metadata" error looks like a red-herring. The real error seems to be this:
Are your Yum repo files corrupt?
The files at
/etc/yum.conf
and/etc/yum.repos.d/*.repo
are provided by theyum
and thecentos-release
packages (Test this withrpm -q --whatprovides /etc/yum.conf /etc/yum.repos.d/*
).Try verifying the files in
/etc/yum.repos.d/
against the RPM files. Have there been any changes?In the following example, the file CentOS-Base.repo has been locally modified:
If you discover that these files have indeed been changed, then you could try reinstalling the rpms, or extracting just the few files that you need and manually move them into place. Back up your old files first, for investigation later.