今天在centos7服务器上用yum的时候发现,yum命令不能用了,不管用yum什么命令都会出现如下提示:

1、错误提示一:

One of the configured repositories failed (Unknown),and yum doesn't have enough cached data to continue.

中文翻译

其中一个已配置的存储库失败(未知),并且yum没有足够的缓存数据可以继续。

2、错误提示二:

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

中文翻译

无法检索存储库的metalink:epel / x86_64。 请验证其路径,然后重试

3、完整的错误提示如下:

One of the configured repositories failed (Unknown),and yum doesn't have enough cached data to continue. At this point the onlysafe thing yum can do is fail. There are a few ways to work "fix" this:1. Contact the upstream for the repository and get them to fix the problem.2. Reconfigure the baseurl/etc. for the repository, to point to a workingupstream. This is most often useful if you are using a newerdistribution release than is supported by the repository (and thepackages for the previous distribution release still work).3. Disable the repository, so yum won't use it by default. Yum will thenjust ignore the repository until you permanently enable it again or use--enablerepo for temporary usage:yum-config-manager --disable <repoid>4. Configure the failing repository to be skipped, if it is unavailable.Note that yum will try to contact the repo. when it runs most commands,so will have to try and fail each time (and thus. yum will be be muchslower). If it is a very temporary problem though, this is often a nicecompromise:yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=trueCannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again


按照网上很多资料都没有解决我的问题,因为:

1、我的服务器 ping 正常的,无论是ping镜像还是ping其它网站都可以ping通。

2、/etc/resolv.conf 里面的 nameserver 114.114.114.114 也是有的,dns也没问题。

解决方法
想要解决问题,必须先要找原因,很多人碰上如上图这种错误的时候,都会首先认为是“错误提示一”这个问题,如果这样想,其实就大错特错了。

出现此问题,最根本的原因是“/etc/yum.repos.d/epel.repo”里面的镜像源路径不对。

既然找到了原因,解决起来就容易多了,具体步骤如下:
1、打开 /etc/yum.repos.d/epel.repo;

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

2、注释掉mirrorlist,取消注释baseurl;

[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch

修改为

[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch

3、再次使用yum命令即正常!

yum clean all
yum makecache
yum update
yum install -y lsof

参考链接 :

yum提示“Cannot retrieve metalink for repository: epel/x86_64” 解决方法

https://www.fujieace.com/linux/epel-x86_64.html

yum提示“Cannot retrieve metalink for repository: epel/x86_64” 解决方法相关推荐

  1. Cannot retrieve metalink for repository: epel…错误解决办法

    RHEL6下yum -y install epel-release安装了epel源,但yum makecache出错. centos下安装完EPEL源然后更新一下yum缓存如果发现这样的错误: Err ...

  2. 使用yum命令时报错Cannot retrieve metalink for repository epel

    使用yum命令时报错Cannot retrieve metalink for repository epel 问题背景 问题分析 问题处理 问题背景 通过Yum安装ftp时报如下错误: $ yum s ...

  3. yum安装时出现:Cannot retrieve metalink for repository: epel. Please verify its path and try again...

    在CentOS 6.3 x86_64下安装php-mcrypt的时候出现了问题:Error: Cannot retrieve metalink for repository: epel. Please ...

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

    安装eple源,在yum clean all:yum makecache 后出现报错 Error: Cannot retrieve metalink for repository: epel. Ple ...

  5. yum报错: 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 解决: [root ...

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

    执行yum install epel-release 出现错误提示: Error: Cannot retrieve metalink for repository: epel. Please veri ...

  7. Error: Cannot retrieve metalink for repository: epel.

    今天给Centos通过rpm -Uvh装了个epel的扩展后,执行yum就开始报错: Error: Cannot retrieve metalink for repository: epel. Ple ...

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

    1.安装epel的yum源,命令是:yum install epel-release -y  有的时候出现了问题:Error: Cannot retrieve metalink for reposit ...

  9. CentOS错误:Cannot retrieve metalink for repository: epel

    解决方法: vi /etc/yum.repos.d/epel.repo 查找https,改为http即可 参考帖子:http://bbs.chinaunix.net/thread-3688613-2- ...

最新文章

  1. 两个有序数组如何合并成一个有序数组
  2. Spring Boot快速开发利器:Spring Boot CLI
  3. 圆弧与直线相切画法_数控编程基础,相切圆弧的基点计算方法
  4. Pytorch模型(.pth)转onnx模型(.onnx)
  5. mysql知识结构图_MySql知识结构说明
  6. Android之AsyncTask两种线程池分析和总结
  7. linux 计算机概论 Linux介绍
  8. 别太相信自己,总有一种诈骗戳中你的刚需
  9. 函数无法识别_IF函数初级用法之一
  10. 设计模式之——过滤器模式(Filter Pattern)
  11. 关于用VGG19网络来做8分类任务的总结
  12. 求职、跳槽中英文简历模板下载集合
  13. 亚美柏科笔试题——java
  14. cdr对象管理器怎么用_CDR新手必看之对象管理的方法
  15. python计算定积分
  16. 京区航天研究所 哪些比较好的研究所?
  17. 计算机图形学(十二):真实感图形(光照模型、材质模型)
  18. python做后端的优势_python做后端好吗
  19. 如何写出高效的代码?(持续更新)
  20. 华为od机考真题-高矮个子排队,算法第九讲-高频真题解析 II

热门文章

  1. html工作界面抽象吗,WEB界面设计五种特征-网页设计,HTML/CSS
  2. nginx服务器配置安全维护,nginx 安全:如何强化服务器配置
  3. python做一副54扑克牌发牌_用Python制作4人扑克牌发牌游戏
  4. a大于10小于15C语言,计算机基础复习模拟试卷
  5. linux查看编译器命令,关于驱动与编译器版本的查询命令
  6. 计算机学习知识,如何学习计算机知识呢
  7. python中的tail()_让VASP实现固定应力张量计算的python脚本
  8. 开发过程中常用的 dos 命令
  9. 基于Matlab----MSK调制与解调
  10. 流程DEMO-费用报销