代码改变世界

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

2022-05-19 14:42  猎手家园  阅读(4071)  评论(0编辑  收藏  举报

出现这个错误的原因就是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/