新安装的系统centos7.6,无法使用yum报错cannot find a valid baseurl for repo:base/7/x86_64
创始人
2024-09-25 12:21:18
0

1.检查网络:尝试ping www.baidu.com是否通

2.检查dns配置:cd /etc/sysconfig/network-scripts 进入网卡配置中,检查onboot是否是yes,增加DNS1=8.8.8.8
DNS2=4.2.2.2

3.更换yum源:下载国内yum源配置文件到/etc/yum.repos.d/CentOS-Base.repo
阿里云 CentOS 7 源(推荐):

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
1
网易163 CentOS 7 源:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
1
搜狐 CentOS 7 源:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.sohu.com/help/CentOS7-Base-sohu.repo
1
华为云 CentOS 7 源:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.myhuaweicloud.com/repo/CentOS-7.repo
1
华东理工大学 CentOS 7 源:

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.ustc.edu.cn/centos/7/os/x86_64
1
清华大学 CentOS 7 源:

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.tuna.tsinghua.edu.cn/centos/7/os/x86_64/
1
北京理工大学 CentOS 7 源:

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.bfsu.edu.cn/centos/7/os/x86_64/
1
上海交通大学 CentOS 7 源:

wget -O /etc/yum.repos.d/CentOS-Base.repo https://ftp.sjtu.edu.cn/centos/7/os/x86_64/
1
中国科学技术大学 CentOS 7 源:

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.ustc.edu.cn/centos/7/os/x86_64/
1
兰州大学 CentOS 7 源:

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirror.lzu.edu.cn/centos/7/os/x86_64/
1
以上命令选择一个就行了                  
原文链接:https://blog.csdn.net/weixin_54626591/article/details/138488919

4.清理yum缓存,并生成新的缓存
yum clean all 
  • 1
yum makecache

相关内容

热门资讯

辅助透视!aapoker破解侠... 辅助透视!aapoker破解侠是真的吗,aapoker透视插件,2025新版(有挂解说)1、辅助透视...
透视黑科技!wepoker底牌... 透视黑科技!wepoker底牌透视(透视)一直是有挂(系统教程);1、wepoker底牌透视ai辅助...
透视肯定!aapoker插件,... 透视肯定!aapoker插件,aapoker透视脚本入口,微扑克教程(有挂脚本);1、进入到aapo...
透视辅助!aapoker公共底... 透视辅助!aapoker公共底牌,aapoker透视脚本入口,2025新版教程(有挂教程)1、打开软...
透视游戏!wepoker永久免... 透视游戏!wepoker永久免费脚本(透视)原来存在有挂(必赢教程)1、构建自己的wepoker永久...
广东雀神智能辅助照片,兴化打两... 广东雀神智能辅助照片,兴化打两圈辅助器,微信小程序边锋辅助攻略1、完成广东雀神智能辅助照片的残局,帮...
透视ai代打!aapoker辅... 透视ai代打!aapoker辅助器是真的吗,aapoker插件下载,插件教程(有挂方法)1、让任何用...
透视能赢!wepoker作弊方... 透视能赢!wepoker作弊方法(透视)确实是有挂(总结教程)1、超多福利:超高返利,海量正版游戏,...
广东雀神挂件去那买,广西友乐辅... 广东雀神挂件去那买,广西友乐辅助app,财神13张辅助系统解密1、在广东雀神挂件去那买ai机器人技巧...
透视透视!aapoker发牌逻... 透视透视!aapoker发牌逻辑,aapoker万能辅助器,微扑克教程(有挂解密)1、aapoker...