1、下载repo源:
1、cd /etc/yum.repos.d/ && cp CentOS-Base.repo CentOS-Base.repo.$(date +%F)
2、wget -SO /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
2、更改发行版本及CPU体系架构参数值($releasever与$basearch)
sed -i.$(date +%F)'s#/$releasever#/6#g;s#/$basearch#/x86_64#g'CentOS-Base.repo
3、清空并新生成yum缓存
1、yum clean all
2、yum update
3、yum makecache