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

2022-8-21    elvin Centos

由于Centos8于2021年年底停止了服务,在使用yum源安装时候,出现下面错误“错误:Failed to download metadata for repo ‘AppStream’: Cannot prepare internal mirrorlist: No URLs in mirrorlist”
解决步骤如下:

1、cd /etc/yum.repos.d/

2、
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-*

3、更新yum源,使用阿里镜像 (如果没安装wget, 先安装. yum install wget)
wget -O /etc/yum.repos.d/CentOS-Linux-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo 

4、yum clean all

5、yum makecache



发表评论