1、安裝wget,如果安裝了就無需安裝
```
yum install -y wget
```
2、備份原yum源
```
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
```
3、下載阿里云的CentOS-Base.repo 到/etc/yum.repos.d/
```
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
```
4、清理緩存
```
yum clean all
```
5、生成新的緩存
```
yum makecache
```
6、更新yum
```
yum -y update
```