当前位置首页 > CentOS知识

centos7cannotfindavalidbaseurlforrepobase(转载)

阅读次数:311 次  来源:admin  发布时间:

centos7 cannot find a valid baseurl for repo base

今天在虚拟机下安装centosmini版本,安装后第一件事就是yum update

但是有错:cannot find a valid baseurl for repo base base

百度了半天也没个很靠谱的,最后google了一下,马上就出来了。

具体链接在这里http://unix.stackexchange.com/questions/22924/how-can-i-fix-cannot-find-a-valid-baseurl-for-repo-errors-on-cento

我是用的其中一个:

cd /etc/sysconfig/network-scripts/

然后找ifcfg 开头的文件,挨个打开

里面有下面那些代码前三行的就是,添加后面DNS两行,保持并退出,然后继续执行两个ifdown and ifup 命令,然后ping www.baodu.com正常的话就没问题可以更新yum了。

ONBOOT=no
NM_CONTROLLED=no
BOOTPROTO=dhcp
DNS1=8.8.8.8
DNS2=4.2.2.2

restart the network interface

ifdown eth0
ifup eth0
上一篇:Linux(Centos)之安装Nginx及注意事项
下一篇:小插曲:旧版debian发行版的deb包归档网站list