美文网首页Linux我用 LinuxLinux学习之路
yum错误Cannot retrieve metalink fo

yum错误Cannot retrieve metalink fo

作者: whisshe | 来源:发表于2019-05-31 09:26 被阅读1次

问题详情

最近在一台服务器上安装epel源后,更新yum缓存或者安装软件就会出现如下错误。

错误详情
要解决方法直接翻到最下面

问题原因

上网查了一下,这是因为epel仓库默认使用的https,如下:

  • epel.repo


    epel仓库
  • epel-tesing.repo


    epel-teing

解决方法

更新ca-certficates包

按照网上的说法,需要更新ca-certficates包。

  • CentOS 7
yum clean all
yum --disablerepo=epel -y update  ca-certificates
  • CentOS6
yum clean all
yum --disablerepo="epel" update nss

我试着更新了,还是一样的报错。但是有人这样做就行了

重建rpm数据库

广大人民群众的智慧是无穷的,又找到一个新的方法。

rpm --rebuilddb

试了,还是没什么卵用。

将https转为http

既然不能用https的仓库,那就直接使用http吧,epel也正好支持http+https两种方式。

sed -i 's#https://#http://#g' /etc/yum.repos.d/epel*repo

问题解决了

相关文章

网友评论

    本文标题:yum错误Cannot retrieve metalink fo

    本文链接:https://www.haomeiwen.com/subject/spvitctx.html