Repository extras is listed more than once in the configuration
CentOS Linux 8 - AppStream 18 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.2.148)
Error: Failed to download metadata for repo 'appstream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
解决方法:针对该问题,阿里云也提供了解决方法,可依次执行如下命令即可解决
该方法只适用于阿里云的ECS服务器,其他IDC公司的服务器可参考教程操作:https://blog.tag.gg/showinfo-3-36185-0.html
1、执行如下命令先将之前的yum文件备份:
2、运行以下命令下载最新的repo文件:rename '.repo' '.repo.bak' /etc/yum.repos.d/*.repo
wget https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo -O /etc/yum.repos.d/Centos-vault-8.5.2111.repo
3、运行以下命令替换repo文件中的链接:wget https://mirrors.aliyun.com/repo/epel-archive-8.repo -O /etc/yum.repos.d/epel-archive-8.repo
sed -i 's/mirrors.cloud.aliyuncs.com/url_tmp/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo && sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo && sed -i 's/url_tmp/mirrors.aliyun.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo
4、运行以下命令重新创建缓存,若没报错,则正常了。sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/epel-archive-8.repo
注意:若使用阿里云服务器参考本教程重新执行后还有问题,请将 进入 /etc/yum.repos.d/ 目录,将之前下载的yum文件(repo)改名后再重新按照本教程操作一次即可yum clean all && yum makecache
文章评论 本文章有个评论