伟明部落格

CentOS 8不再支持yum源的应对

--发布于 2022-07-02 20:29:28

CentOS 8系统安装宝塔面板提示Error: Failed to download metadata for repo 'epel': Cannot download repomd.xml: Cannot download ...Status code: 404 for这是由于Centos 8版本已停止更新相应依赖,下载新的yum源即可解决,新手站长来详细说下CentOS 8安装宝塔面板报错及解决方法:

CentOS 8安装宝塔面板错误Error...epel...404

Linux服务器CentOS 8版本操作系统执行宝塔安装命令报错如下图:

Error: Failed to download metadata for repo 'epel'

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

原因:第三方的镜像站中均已移除CentOS 8的源,Centos 8版本已停止更新相应依赖导致的,下载新的yum源即可搞定。解决方法如下:

1、SSH连接到你的CentOS 8云服务器 2、备份之前的repo文件,命令:

mv /etc/yum.repos.d /etc/yum.repos.d.bak

3、创建源文件目录,命令:

mkdir -p /etc/yum.repos.d

4、下载新的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

执行上述4条命令,如下图:

CentOS 8更新yum源

更新完yum源后,再次执行宝塔安装命令即可正常安装。

参考

CentOS 8安装软件出现Errors during downloading…’epel’ Status code: 404解 CentOS 8安装宝塔Errors during downloading…’epel’ Status code: 404

--更新于 2023-03-09 10:51:41