转自:http://lovegood.sinaapp.com/article/view/5-61.html
cd /etc/yum.repos.d/
wget http://mirrors.163.com/.help/CentOS-Base-163.repo
wget http://mirrors.sohu.com/help/CentOS-Base-sohu.repo
yum makecache
确认是否成功:可以随便找一个 yum 包进行安装,在安装时用 netstat 命令查看连接的IP都是哪里的,就知道你有没有成功了。
【Yasi】遇到下面问题时,请执行 rpm --import /etc/pki/rpm-gpg/RPM* ,参考
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897
Refusing to automatically import keys when running unattended.