Centos 更换yum

解决centos 6 更换yum 163源报错

http://mirrors.163.com/centos/6.5/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - “The requested URL returned error: 404 Not Found”
Trying other mirror.
To address this issue please refer to the below wiki article
https://wiki.centos.org/yum-errors
If above article doesn’t help to resolve this issue please use https://bugs.centos.org/.
解决方案

cd /etc/yum.repos.d
vi CentOS-Base.repo
:%s/KaTeX parse error: Expected 'EOF', got '#' at position 16: releasever/7/g #̲将文件中releasever全部改成7
yum clean all && yum makecache # 清除和缓存

注意::%s/$releasever/7/g命令是在vi刚进去的模式下执行的,不是insert模式(对于新手可能不理解)
原因

原centos/6/ 以及以前的版本,已经没有相关的.xml文件,找不到所以才会报错(我们可以在浏览器中试一试就可以发现它,没有那个文件了)

在这里插入图片描述

centos7中有相关文件,将CentOS-Base.repo文件中的6改成7即可使用
在这里插入图片描述

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值