linux下yum错误:[Errno 14] problem making ssl connection Trying other mirror.

今天是要yum命令安装EPEL仓库后

yum install epel-release

突然发现yum安装其他的软件出错。

错误:
[Errno 14] problem making ssl connection Trying other mirror.
Trying other mirror
Error: Cannot retrieve repository metadata (repomd.xml) for repository: xxxx. Please verify its path and try again

于是去网上查了查,发现许多解决方法。似乎是ssl证书的原因,最终选择

[root@redhat2 ~]# cd /etc/yum.repos.d/
[root@redhat2 yum.repos.d]# ls
CentOS6-Base-163.repo  epel.repo(修改他)  epel-testing.repo
[root@redhat2 yum.repos.d]# pwd
/etc/yum.repos.d
[root@redhat2 yum.repos.d]# 

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

将baseurl注释去掉,为mirrorlist加上注释。然后将enabeld=1变为0,禁用ssl证书验证。

找到了两种方法(都使用了):

yum install ca-certificates
yum update curl

然后再将enable设置为1即可

原文地址:https://www.cnblogs.com/ssyfj/p/9178745.html