1. Backup old configuration files
cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.bak
2. Download the files of Aliyuan
sudo wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3. Update yum to rebuild the cache
yum clean all
yum makecache