【Linux】CentOS 7——yum报错:cannot find a valid baseurl for repo:base/7/x86_64的解决方案
·
问题描述
2024年6月30日之后,CentOS7停止维护,导致yum无法使用
在CentOS系统中使用yum安装g++编译环境时,报错信息如下:
cannot find a valid baseurl for repo:base/7/x86_64
解决方案 1
- 连接服务器输入
yum repolist, repolist 显示是 0吗,输入yum update肯定报错
- 输入以下命令:
github原作者链接
bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/ChangeMirrors.sh)
进入下列界面:
- 输入你需要的镜像源,安装过程如下:

再次查看yum repolist,其中已经多出30000多个仓库文件
安装gcc编译环境
yum -y install gcc*
安装过程中,出现问题
问提分析:
把gpgcheck=1 改为gpgcheck=0 即可,意思是在安装的时候不进行源的检查
vi 打开 vi /etc/yum.repos.d/epel.repo
vi /etc/yum.repos.d/epel.repo
更多推荐



所有评论(0)