CentOS8 敲入yum makecache命令后报错,“为 repo 'base' 下载元数据失败 : Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
”,如下:
[root@iZbp17rvt7ixtpv5klxqmnZ ~]# yum makecache
CentOS-8 - Base - mirrors.aliyun.com 77 B/s | 2.3 kB 00:30
Errors during downloading metadata for repository 'base':
- Status code: 404 for http://mirrors.cloud.aliyuncs.com/centos/8/BaseOS/x86_64/os/repodata/repomd.xml (IP: 100.100.2.148)
- Curl error (28): Timeout was reached for http://mirrors.aliyuncs.com/centos/8/BaseOS/x86_64/os/repodata/repomd.xml [Connection timed out after 30000 milliseconds]
- Status code: 404 for https://mirrors.aliyun.com/centos/8/BaseOS/x86_64/os/repodata/repomd.xml (IP: 39.96.118.189)
错误:为 repo 'base' 下载元数据失败 : Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
在网上找了很多资料,跟着许多解决办法做了以后都无法解决这个问题。
经过一番折腾以后,来到了阿里云开发者社区,发现了这么一段话,
原来是官方源已经下线了,更换了社区给的centos-vault源之后,完美运行。
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
问题解决,在此记录。