1. 首先要安装wget
`[root@localhost ~]# yum -y install wget`
1. 备份 旧的yum源
`[root@localhost ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak`
1. 下载新的yum源
`[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo`
1. 更新
` [root@localhost ~]# yum makecache`
` [root@localhost ~]# yum -y update`