由于yum出现异常,修改出好多问题,决定卸载之后重新下载,参考文章:“yum的卸载与重新安装”链接:https://blog.youkuaiyun.com/m0_37886429/article/details/75009382
但是,删除之后,发现下载不了。
查询之后,发现yum的下载地址变更为:
wget https://vault.centos.org/6.10/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm
下载之后,安装:

由于上一个版本的历史遗留问题,发现yum makecache失败,失败原因如下:
http://mirrors.aliyun.com/centos/6/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 knowledge base article
https://access.redhat.com/articles/1320623
If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.
http://mirrors.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 7 - "couldn't connect to host"
Trying other mirror.
http://mirrors.cloud.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.cloud.aliyuncs.com'"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
然后修改文件:vim /etc/yum.repos.d/CentOS-Base.repo,如图:

修改地址为:https://vault.centos.org/6.10/os/$basearch/
全部修改方法:vim 中的替换命令
再次yum makecache 成功

yum中 yum.repos.d 中文件下载
如果一不小心把/etc/yum.repos.d/文件夹中的文件CentOS-Base.repo等删除了,那您需要重新下载一份,下载地址为:
https://vault.centos.org/6.10/os/x86_64/Packages/centos-release-6-10.el6.centos.12.3.x86_64.rpm
根据您的CentOS版本,在 https://vault.centos.org中选择版本。

本文档详细记录了在CentOS系统中因yum异常导致的问题,包括卸载并重新安装yum的过程。在卸载后,发现无法下载新版本,问题在于yum的默认下载地址已变更。解决方案是更新CentOS-Base.repo文件中的URL为https://vault.centos.org/6.10/os/$basearch/。通过使用vim编辑器进行替换操作,修复yum缓存失败的问题,并成功执行yum makecache。此外,还提供了在不慎删除/etc/yum.repos.d/文件后如何重新获取CentOS-Base.repo文件的方法。
5344

被折叠的 条评论
为什么被折叠?



