执行yum命令出现该错误。

Cannot find a valid baseurl for repo: base

ping www.baidu.com 不通,但是内网是通的;

检查步骤:

  1. 确认本地ip、DNS没问题;

  2. 检查网关;
    查看route:

    发现:没有默认网关。
    解决:执行route add default gw 192.168.1.1 dev eth0

==


yum -y install wget

已加载插件:fastestmirror
设置安装进程
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
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
错误:Cannot find a valid baseurl for repo: base


==

vi /etc/resov.conf

find / -name resov.conf
vi /etc/resov.conf
ls /etc/yum.repos.d
vi CentOS-Base.repo

find / -name ifcfg-eth0

vi /etc/sysconfig/network-scripts/ifcfg-eth0

cat /proc/version

reboot

vi /etc/resolv.conf

里面加了一句:

# Generated by NetworkManager
nameserver 192.168.1.1
nameserver 114.114.114.114


ping www.baidu.com

ping mirrorlist.centos.org