yum makecache报错

  • A+
所属分类:Linux 学习笔记

http://mirrors.aliyun.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found

http://mirrors.aliyuncs.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyuncs.com/centos/$releasever/os/x86_64/repodata/repomd.xml: (28, 'Connection timed out after 30000 milliseconds')

这是yum源中$releasever不能被系统识别

修改/etc/yum.repos.d/CentOS-Base.repo中$releasever为对应的系统版本路径,比如centos7就改为7

VI全局替换命令:

::%s/$releasever/7/g

yum makecache报错

替换后

yum makecache报错

然后安装 yum install centos-release

yum makecache报错

在/etc/yum.repos.d生成了新的源文件CentOS-Base.repo.rpmnew,修改覆盖之前的文件$releasever就可以正常解析了。

yum makecache报错

mv CentOS-Base.repo.rpmnew CentOS-Base.repo

yum makecache报错

最后yum makecahce即可

参考:https://blog.csdn.net/weixin_41100576/article/details/103544746

zore

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: