Welcome

首页 / 操作系统 / Linux / CentOS8 错误:为 repo ‘appstream‘ 下载元数据失败 : Cannot prepare internal mirrorlist: No URLs in mirrorlist的解决办法

CentOS8 错误:为 repo ‘appstream‘ 下载元数据失败 : Cannot prepare internal mirrorlist: No URLs in mirrorlist的解决办法

出现上述办法的原因是CentOS已经停更,但因为CentOS系统的易用性,国内有很多继续延伸的源可以用。

要解决上述方法。首先

先将/etc/yum.repos.d/下的所有文件备份或者删除

备份:

cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

批量重命名

rename '.repo' '.repo.bak' /etc/yum.repos.d/*.repo

上述操作之后,重新获取阿里源

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

最后执行

yum makecache

更新本地源,之后应该就可以使用国内源进行系统软件的安装与更新了。