报错:Failed to download metadata for repo ‘appstream’

2022年8月11日 | 分类: 【技术】

当新开一个CentOS8服务器,在更新系统时,报错:

CentOS Linux 8 - AppStream                       31  B/s |  38  B     00:01
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

参考:https://techglimpse.com/failed-metadata-repo-appstream-centos-8/

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