编辑配置文件
vim /etc/yum.repos.d/CentOS-Base.repo
将以下内容复制到配置文件中
[base]
name=CentOS-6
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.5/os/x86_64/
gpgcheck=0
生成缓存
yum clean all#清除全部
yum makecache#生成缓存
也可以
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-6.repo或者wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-6.repo
报错分析
1:是否配置DNS1,验证通过Centos6.5浏览器访问www.baidu.com,不通,需要配置DNS1
也可以参考
CentOS 镜像