首页 > 其他分享 >Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlis

Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlis

时间:2022-11-16 17:55:50浏览次数:75  
标签:CentOS prepare repos repo etc mirrorlist yum appstream

报错原因:

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

最终原因是源的问题,解决办法也是解决源的问题。

 

解决办法如下:

1、进入yum的repos目录

cd /etc/yum.repos.d/

2、修改所有的CentOS文件内容

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 -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

yum clean all

yum makecache

  

标签:CentOS,prepare,repos,repo,etc,mirrorlist,yum,appstream
From: https://www.cnblogs.com/afeige/p/16896828.html

相关文章