linux yum baseurl,解决CentOS系统Yum出现”Cannot find a valid baseurl for repo”问题 | 老左笔记...

有网友告知老左自己在腾讯云服务器上部署环境使用到yum命令的时候提示无法执行脚本有出现"Cannot find a valid baseurl for repo"问题提示。看到这样的问题肯定是源不通导致的,先搜索搜索是否有同样的解决方法,有的人用到需要更新repo的,也有的简单更新DNS的。

0915cda17ec94258aadb8befd7efaf5b.png

错误提示:

[[email protected]_17_139_centos ~]# yum -y install wget screen python

Loaded plugins: fastestmirror, security

Setting up Install Process

Repository updates is listed more than once in the configuration

Repository contrib is listed more than once in the configuration

Repository extras is listed more than once in the configuration

Loading mirror speeds from cached hostfile

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os&infra=stock error was

12: Timeout on http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os&infra=stock: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds')

Error: Cannot find a valid baseurl for repo: base

因为问题我也没有遇到过,就先用简单的方法试试,更换DNS。

vi /etc/resolv.conf

然后将DNS换成两组 8 8 8 8 和 8 8 4 4

保存后退出,然后我们在执行yum命令可以看到是可以解决问题的。

ebf846285a131e4d8d45fa9a130f7ee0.png

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值