Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

安装完运行yum报错:

Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

提示原因为资源库路径获取错误,解决办法是改成正确的资源库路径即可。

解决办法:

vi /etc/yum.repos.d/epel.repo

编辑[epel]下的baseurl前的#号去掉,mirrorlist前添加#号。正确配置如下:

[epel]

name=Extra Packages for Enterprise Linux 6 - $basearch

baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch

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

failovermethod=priority

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

再运行

yum makecache

或者

yum repolist

 

原文地址:https://www.cnblogs.com/guanghuiqq/p/11431539.html