Thursday, March 15, 2012

Yum cannot retrieve repository metadata for CentOS 5

If you encountered this type of errors, do look at your repo configuration at /etc/yum.repos.d. In my situation, I was trying to update a package which falls under Centos-Base.repo

http://mirror.centos.org/centos/5/addons/x86_64/repodata/repomd.xml: [Errno 12] 
Timeout: 
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: 
addons. Please verify its path and try again


http://mirror.centos.org/centos/5/addons/x86_64/repodata/primary.sqlite.bz2: 
[Errno 12] Timeout: Trying other mirror.
http://mirror.centos.org/centos/5/addons/x86_64/repodata/primary.sqlite.bz2: 
Errno 12] Timeout: Trying other mirror.
Error: failure: repodata/primary.sqlite.bz2 from addons: 
[Errno 256] No more mirrors to try.
 

3 things you need to do
  1. Check that your mirriorlist in /etc/yum.repo.d is uncommented. It should look something like
    mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
  2. Check that your baseurl is uncommented. (Usually this is not needed, but this is a last resort
    baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
  3. Type the parameter in the repo list
    enabled=1


1 comment:

Daniel Boorn said...

Solved my issue. Thank you!!