Wednesday, January 16, 2013

Issues with CentOS 6 and EPEL

I was running into some issues with the EPEL repo on CentOS 6.x. I had just installed the OS and the EPEL/remi repos and whilst trying to search for a package the same error kept repeating.

Cannot retrieve metalink for repository: epel

and it kept failing each time.

The fix involved editing the EPEL repo and making a simple change from https to http. Why or how this broke is beyond me, but this fix may help someone else.

Assuming you have root or su:

1. Edit the epel repo
nano /etc/yum.repos.d/epel.repo

Find line:
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch

Change to
mirrorlist=http://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch

Save and exit.

2. Clean yum
yum clean all


That did it for me!

Cheers,
noveck 

4 comments:

  1. thx for the post. just had the same problem now.
    funny thing is that out of 15 identical (or seemingly so) setups this was only a problem on one machine, and also only since a few days. no clue so far why this happened. but the solution above at least solved the problem (actually it is more of a workaround).

    ReplyDelete
  2. This is better solved by updating your out-of-date ca-certificates:
    yum update ca-certificates --disablerepo=epel

    ReplyDelete