环境说明:
centos6.4
安装步骤如下:
- 执行
yum install epel-release
- 执行
yum clean all
清除缓存 - 执行
yum makecache
重建缓存,注意此时可能会出现如下报错
[root@localhost ~]# yum makecache
Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
这个报错是因为机器的CA证书过期了,需要更新下证书。更新的步骤如下:
4. 执行rpm -qa |grep ca-certificates
查看CA证书,我的环境版本如下。
[root@localhost ~]# rpm -qa |grep ca-certificates
ca-certificates-2010.63-3.el6_1.5.noarch
- 执行
yum --disablerepo=epel -y update ca-certificates
更新CA证书。 - 执行
yum makecache
确认成功。
说明:
关于这个报错,有些人说的方法是将下面配置文件的baseurl注释取消,然后将mirrorlist注释。本人亲测发现没有管用。
[root@localhost ~]# vim /etc/yum.repos.d/epel.repo
[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