centos7 cannot find a valid baseurl for repo base
2016-04-13 20:24
274 查看
今天在虚拟机下安装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-centos
我是用的其中一个:
然后找ifcfg 开头的文件,挨个打开
里面有下面那些代码前三行的就是,添加后面DNS两行,保持并退出,然后继续执行两个ifdown and ifup 命令,然后ping www.baodu.com正常的话就没问题可以更新yum了。
restart the network interface
但是有错: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-centos
我是用的其中一个:
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
相关文章推荐
- CentOS 7中安装mysql server的步骤分享
- centos 7安装mysql5.5的方法
- centos 7安装mysql5.5和安装 mariadb使用的命令
- CentOS 7安装python3笔记
- Centos7 常用命令
- Centos7 修改主机名
- Centos7 关闭防火墙
- CentOS7上编译多版本PHP并同时运行及systemd设置
- CentOS安装VirtualBox增强功能
- CentOS 7.1 (6.6)PXE网络自动化安装
- centos7将网卡名字改成eth样式
- centos7下载
- CentOS7 - systemd服务
- Centos7 修改运行级别
- centos 7 安装配置centos 7
- centos7 yum 安装mysql
- centos7 hostnamectl
- 如何在CentOS 7 / RHEL 7 运行单用户模式进行root的密码重置