由于 appstream,centos 上的镜像列表中没有 yum 的 URL

chi*_*osu 1 centos yum

据我所知,今天早上从一个新鲜的 centos 容器开始。

[root@2804aec3e418 /]# yum update
Failed to set locale, defaulting to C.UTF-8
CentOS Linux 8 - AppStream                                                                                                                                     59  B/s |  38  B     00:00    
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
[root@2804aec3e418 /]# 
Run Code Online (Sandbox Code Playgroud)

fro*_*tin 5

由于这个问题已经结束,答案不是最好的选择,我把它写在这里。

您的镜像或您依赖的基础镜像使用 CentOS Linux 8,该版本已达到 EOL 状态

您应该转而使用较新的映像,或者如果您直接使用 CentOS Linux 8,请切换到另一个基础映像。

如果您现在被迫继续使用它。您可以切换到使用旧的存储库,然后使用以下命令切换到 CentOS Stream 8 存储库

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*; \
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*; \

dnf update -y; \
dnf --disablerepo '*' --enablerepo extras swap centos-linux-repos centos-stream-repos -y; \
dnf distro-sync -y;
Run Code Online (Sandbox Code Playgroud)

https://www.centos.org/centos-stream/中记录了向 CentOS Stream 8 的切换:

CentOS Linux 8 到 CentOS Stream 8