错误:为仓库 'BaseOS' 下载元数据失败 : Cannot prepare internal mirrorlist: No URLs in mirrorlist

执行yum makecache命令报错

CentOS-8 - Base                                              7.1  B/s |  38  B     00:05    
错误:为仓库 'BaseOS' 下载元数据失败 : Cannot prepare internal mirrorlist: No URLs in mirrorlist

执行yum install gcc命令报错

CentOS-8 - AppStream                                                                            
错误:为仓库 'AppStream' 下载元数据失败 : Cannot prepare internal mirrorlist: No URLs in mirro

 

https://blog.csdn.net/qq_42209718/article/details/122876954

阿里镜像站:https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.74ab1b11JEvySJ

#备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
#下载新的base.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
或
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
#生成huanc
yum makecache

结果

 

posted @ 2022-03-04 13:56  wujingqi  阅读(4529)  评论(0编辑  收藏  举报