Centos8 Error: Failed to download metadata for repo ‘appstream‘: Cannot prepare internal mirrorlist:

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

 If the wget command does not exist

/usr/bin/yum install wget

 Use Alisource

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
yum clean all
yum makecache

Guess you like

Origin blog.csdn.net/qq_29752857/article/details/132001643