yum报错http://mirrors.aliyun.com/centos/7/contrib/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 40

1、安装完yum后,/etc/yum.repos.d/目录下,应该是这些原因。

  • CentOS-Base.repo
  • CentOS-CR.repo
  • CentOS-fasttrack.repo
  • CentOS-Sources.repo
  • CentOS-Debuginfo.repo
  • CentOS-Media.repo
  • CentOS-Vault.repo

2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/

  1. wget http://mirrors.aliyun.com/repo/Centos-7.repo

3、清除系统yum缓存并生成新的yum缓存

yum clean all # 清除系统所有的yum缓存
yum makecache # 生成yum缓存 

但是在执行yum makecache是会遇到错误

1、one of the configured repositories failed (CentOS-7 - Contrib - mirrors.aliyun.com),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail.

  • CentOS 7的一个配置仓库出错了,名称是"(CentOS-7 - Contrib - mirrors.aliyun.com)"。

  • Contrib仓库是CentOS系统的附加软件仓库,里面包含着不属于CentOS默认功能和包的额外软件。

  • mirrors.aliyun.com是阿里云提供的CentOS镜像站地址。

  • 这说明这个Contrib仓库从阿里云镜像站下载包文件时失败了。

  • 由于失败,yum缓存里没有足够的数据可以继续操作。

2、One of the configured repositories failed (CentOS-$releasever - Base - mirrors.aliyun.com),
and yum doesn't have enough cached data to continue.

  • CentOS系统中配置的一个软件仓库失败了,名称为"(CentOS-$releasever - Base - mirrors.aliyun.com)"。

  • 这里的"$releasever"表示当前CentOS系统版本号。

  • "Base"表示系统基础软件仓库。

  • mirrors.aliyun.com是阿里云提供的CentOS镜像服务器地址。

  • 系统在从阿里云镜像服务器下载基础软件包时失败了。

  • 由于下载失败,yum软件包管理工具本地缓存的数据不足,无法继续后续的软件操作。

遇到这两个问题时,将对应源下面的 enabled=1,改为enabled=0即可。

在有些时候yum不能使用的原因时文件中设置enabled=0,禁用了源。

  • 6
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值