第三方的镜像站中均已移除CentOS 8的源,Centos 8版本已停止更新相应依赖导致的,下载新的yum源
yum命令失败:
Errors during downloading metadata for repository 'epel':
- Status code: 404 for http://archives.fedoraproject.org/pub/archive/epel/8/Everything/x86_64/repodata/repomd.xml (IP: 38.145.60.24)
Error: Failed to download metadata for repo 'epel': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
1、备份之前的repo文件,命令:
mv /etc/yum.repos.d /etc/yum.repos.d.bak
2、创建源文件目录,命令:
mkdir -p /etc/yum.repos.d
3、下载新的yum源,分别执行以下2条命令:
先输入
curl https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo > /etc/yum.repos.d/Centos-vault-8.5.2111.repo
后输入即可
curl https://mirrors.aliyun.com/repo/epel-archive-8.repo > /etc/yum.repos.d/epel-archive-8.repo