2

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 ?

1
  • Did you check what you have in those mirrorlist.txt files? Sep 21, 2011 at 21:30

3 Answers 3

1

The "Cannot retrieve repository metadata" error looks like a red-herring. The real error seems to be this:

YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. </html>/

Are your Yum repo files corrupt?

The files at /etc/yum.conf and /etc/yum.repos.d/*.repo are provided by the yum and the centos-release packages (Test this with rpm -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:

% rpm --verify centos-release yum
S.5....T  c /etc/yum.repos.d/CentOS-Base.repo

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.

2
  • thank you Stefan - in fact, some files seems to be corrupt. you can find my output above. what's next? how to repair these files ?
    – mate64
    Sep 22, 2011 at 8:55
  • @msec: I updated my answer with some suggestions. Sep 22, 2011 at 17:49
1

Try a yum clean all and retry your initial yum -y update

3
  • i've edited my post - unfortunately "yum clean all" was without success :-(
    – mate64
    Sep 21, 2011 at 21:20
  • Do you have a firewall or network access issue?
    – ewwhite
    Sep 21, 2011 at 21:26
  • no, the server is online. i've disabled iptables /etc/init.d/iptables stop without success: same error
    – mate64
    Sep 21, 2011 at 21:45
1

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,

lynx http://mirrorlist.centos.org/?release=5&arch=i386&repo=addons
lynx http://mirrorlist.centos.org/?release=5&arch=i386&repo=os

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .