1.下载yum源
http://mirrors.163.com/.help/CentOS6-Base-163.repo
2.把下载好的yum源放到/etc/yum.repos.d下
mv CentOS6-Base-163.repo CentOS-Base.repo yum clean all yum makecacke
3.yum install xxxx 报错:
http://mirrors.163.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.163.com'" Trying other mirror. Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
解决方案:
修改一下 /etc/resolv.conf
添加一个nameserver 8.8.8.8完成
nameserver 8.8.8.8