Question: I was trying to install Xen server on CentOS 6.4 via yum install xen, but yum failed with an error message as “Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again“. How to solve this?
Snapshot of the error:
# yum install centos-release-xen
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
# yum install xen
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
Solution:
The issue is because, the EPEL repos are by default set to use https (this is not an issue actually, but the ca-certificates used for https). It means, you need to have an updated CA certificates. There are couple ways you can fix this issue.
Option 1: You can simply change the EPEL repo endpoint to use http protocol instead of https. To do that, run the below command as root.
# sed -i "s/mirrorlist=https/mirrorlist=http/" /etc/yum.repos.d/epel.repo
(or)
# vi /etc/yum.repos.d/epel.repo
and change mirrorlist to point to ‘http‘ instead of ‘https‘
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
to
mirrorlist=http://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearchm
Option 2: Update SSL certificates
yum upgrade ca-certificates --disablerepo=epel
Note: disable epel repo while upgrading the ca-certificates.
That’s it! You can continue to use EPEL repo normally for ‘yum’ installs.
Related : Useful Yum commands