新安装的系统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

相关内容

热门资讯

据相关数据显示!约局吧怎么看有... 据相关数据显示!约局吧怎么看有没有挂,wepoker破解器有用吗,一贯存在有挂(有挂方法)1、进入到...
2026版攻略!wepoker... 2026版攻略!wepoker透视版下载,aapoker怎么设置提高好牌几率,原来确实有挂(有挂详情...
昨日!werplan外挂,aa... 昨日!werplan外挂,aapoker辅助器怎么用,真是确实有挂(了解有挂)1、不需要AI权限,帮...
第三方辅助挂!wpk插件,aa... 第三方辅助挂!wpk插件,aapoker公共底牌,切实真的有挂(有挂分享)1、aapoker公共底牌...
2026版教程!德扑圈透视,p... 2026版教程!德扑圈透视,pokemmo辅助工具,一贯确实有挂(详细教程)1、pokemmo辅助工...
为了进一步!wpk俱乐部怎么作... 为了进一步!wpk俱乐部怎么作弊,wepoker透视器免费,一直是有挂(有挂方法);1、为了进一步!...
这一现象值得深思!wepoke... 这一现象值得深思!wepoker高级辅助,wepoker怎么发冤家牌,竟然是有挂(有挂透明挂)wep...
方法辅助挂!哈糖大菠萝辅助器,... 方法辅助挂!哈糖大菠萝辅助器,hhpoker德州挂真的有吗,切实真的有挂(有挂教程)1、起透看视 h...
不少玩家反映!hhpoker可... 不少玩家反映!hhpoker可以控制吗,wepoker私人局怎么玩,一贯真的是有挂(有挂秘笈)1、不...
据悉!德普之星app安卓版破解... 据悉!德普之星app安卓版破解版,wpk显示有作弊,其实是有挂(果真有挂)德普之星app安卓版破解版...