centos下yum执行报错:Failed to download metadata for repo 'AppStream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

 查看centos版本

cat /etc/centos-release

 

 下载新的CentOS.repo

根据自己的centos版本下载对应的,可在 https://mirrors.aliyun.com/repo/ 下查看已有aliyun已提供的版本。之前下载的 Centos-8.repo 后,仍会一直报各种安装更新错误找不到源的情况,改为 Centos-vault-8.5.2111.repo ,问题就不存在了。

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

运行 yum makecache 生成缓存

yum makecache

 

参考地址:

https://blog.csdn.net/csdn2561/article/details/122902764

posted on 2022-02-23 11:19  爱吃柠檬不加糖  阅读(2503)  评论(0)    收藏  举报

导航