错误:为repo 'appstream' 下载元数据失败 : Cannot prepare internal mirrorlist: No URLs in mirrorlist

By | 2022-10-20

出现这个错误的原因就是CentOS官方不维护了,yum源使用不了。

解决办法:

修改yum源,比如修改成阿里云的yum源,传送门:https://www.cnblogs.com/hunttown/p/16287988.html

简单的修改办法:

进入到目录 /etc/yum.repos.d下面,分别将 CentOS-Linux-BaseOS.repo 、CentOS-Linux-AppStream.repo、CentOS-Linux-Extras.repo 三个文件中的原 mirrorlist 注释掉,然后新增一行:

baseurl=https://mirrors.aliyun.com/centos/$releasever-stream/extras/$basearch/os/

6、重新缓存

清理

yum clean all

生成缓存

yum makecache