Press "Enter" to skip to content

Decker安装centos系统镜像运行该容器报Failed to download metadata for repo‘AppStream’错误

原因

CentOS Linux 8 已于 2021 年 12 月 31 日结束生命周期 (EOL)。这意味着 CentOS 8 将不再从 CentOS 官方项目获得开发资源。在 2021 年 12 月 31 日之后,如果需要更新CentOS,需要将镜像更改为 vault.centos.org

解决方案

第1步:进入 /etc/yum.repos.d/ 目录。

[root@server ~]# cd /etc/yum.repos.d/

第2步:运行如下两条命令更换镜像。

[root@server ~]# sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
[root@server ~]# sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

第3步:再次运行 yum update 命令。

[root@server ~]# yum update -y

完美解决!

发表评论