一 备份
#mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
二 进入yum源配置文件所在文件夹
# cd /etc/yum.repos.d/
三 下载163的yum源配置文件,放入/etc/yum.repos.d,一定先备份 CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
四 运行yum makecache生成缓存
# yum makecache
五 更新系统
#yum -y update