首页 > 其他分享 >问题解决:Failed to download metadata for repo ‘appstream‘: Cannot prepare internal mirrorlist

问题解决:Failed to download metadata for repo ‘appstream‘: Cannot prepare internal mirrorlist

时间:2022-12-28 04:00:21浏览次数:47  
标签:CentOS prepare repos repo etc mirrorlist yum appstream

https://cloud.tencent.com/developer/article/1993317

 

大家都知道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

4、yum安装测试是否可以yum安装

yum install wget –y

这个问题解决花了半个小时,越来越讨厌那些哔哔半天讲不到点上的了。教程能用就能用,不能用就是过期了,一些 debug 的文章非要绕来绕去绕来绕去。

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

相关文章