今天在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 only
safe 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 working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Disable the repository, so yum won't use it by default. Yum will then
just 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 much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
Cannot 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
微信视频投屏:
1、在手机端微信中会拦截投屏功能,需要首先点击视频页面右上角“...”图标,选择“在浏览器中打开”,在列表中选取具备投屏功能的浏览器,推荐使用QQ浏览器
2、在新打开的浏览器视频页面里,点击播放按钮,可在视频框右上角看到一个“TV”投屏小图标,只要电视和手机在同一WiFi环境下,点击按钮即刻享受大屏观感!
本站资源声明:
1、如需免费下载云盘资源,请先点击页面右上角的“登录”按钮,注册并登录您的账号后即可查看到网盘资源下载地址;
2、本站所有资源信息均由网络爬虫自动抓取,以非人工方式自动筛选长效资源并更新发布,资源内容只作交流和学习使用,本站不储存、复制、传播任何文件,其资源的有效性和安全性需要您自行判断;
3、本站高度重视知识产权保护,如有侵犯您的合法权益或违法违规,请立即向网盘官方举报反馈,并提供相关有效书面证明与侵权页面链接联系我们处理;
4、作为非盈利性质网站,仅提供网络资源的免费搜索和检测服务,无需额外支付其他任何费用,学习和交流的同时请小心防范网络诈骗。