> CentOS > CentOS故障 >

CentOS运行yum报错解决办法

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


1、解决办法:

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

注意:上面的说有的baseurl都放行
所有的mirrorlist都在用#注销掉



2、再运行
yum makecache
(责任编辑:IT)