用的阿里的云服务器
最后发现是阿里的镜像站有变化:https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.73db1b11siwlNO
[root@111]# yum update
Repository 'AppStream' is missing name in configuration, using id.
Repository AppStream is listed more than once in the configuration
Warning: failed loading '/etc/yum.repos.d/CentOS-Epel.repo', skipping.
Repository extras is listed more than once in the configuration
Repository PowerTools is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
CentOS-8 - AppStream 8.4 kB/s | 2.3 kB 00:00
Errors during downloading metadata for repository 'AppStream':
- Status code: 404 for http://mirrors.cloud.aliyuncs.com/centos/8/AppStream/x86_64/os/repodata/repomd.xml (IP: 100.100.100.100)
Error: Failed to download metadata for repo 'AppStream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
做了很多尝试都没有解决。
最终的解决思路就是
解决思路就是删除之前的repo文件,下载新的repo文件。
# 进入yum目录
cd /etc/yum.repos.d
# 删除目录下所有文件(注意完整复制,不要漏了那个点)
rm -rf ./*
# 安装正确的源
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
# 生成缓存
yum makecache
[root@iZ2zedlnapeq3gssx2zcymZ yum.repos.d]# yum makecache
CentOS-8.5.2111 - Base - mirrors.aliyun.com 1.3 MB/s | 4.6 MB 00:03
CentOS-8.5.2111 - Extras - mirrors.aliyun.com 13 kB/s | 10 kB 00:00
CentOS-8.5.2111 - AppStream - mirrors.aliyun.com 1.2 MB/s | 8.4 MB 00:06
Last metadata expiration check: 0:00:01 ago on Tue 29 Mar 2022 10:45:38 AM CST.
Metadata cache created.
就行了