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

yum安装Linux软件
先查询是否已安装epel-release ,没有则执行yum install epel-release–y安装;
检查epel源
安装好epel源后,用yum 命令来检查epel是否添加到源列表:yum repolist
最后安装你要的软件
yum install -y collectd;
centos下安装完EPEL源然后更新一下yum更新缓存如果发现这样的错误:
[root@cloud yum.repos.d]# yum -y install mod_SSL
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
方法一、
这就表明你需要更新CA证书了,那么只需要更新CA证书就可以,不过在此同时需要临时禁用epel源并更新就可以了,命令如下:
yum --disablerepo=epel -y update ca-certificates
方法二、处理很简单,修改文件“/etc/yum.repos.d/epel.repo”, 将baseurl的注释取消, mirrorlist注释掉即可。(此情况使用于Centos通过rpm -Uvh装了个epel的扩展后,执行yum就开始报错

编辑/etc/yum.repos.d/epel.repo,把基础的恢复,镜像的地址注释掉

#baseurlmirrorlist

改成

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
修改为

[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

再清理源,重新安装
      yum clean all
      yum install -y 需要的包
 
方法三、如果以上方法还是不行,尝试修改DNS,到/etc/resolv.conf下添加一下:

nameserver 8.8.8.8 

search localdomain

然后重启network服务:service network restart

【问题总结】

一般这类问题都出线在低版本的操作系统例如centos6.0,所以需要更新内核或者各个软件即可解决根本性问题。



猜你喜欢

转载自blog.csdn.net/English0523/article/details/80852776
今日推荐