1.将原有官方源CentOS-Base.repo进行备份
[root@centos7 ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2.查看备份情况
[root@centos7 ~]# ll /etc/yum.repos.d/
3.下载阿里云镜像源
[root@centos7 ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
4.清理缓存
[root@centos7 yum.repos.d]# yum clean all
5.生成缓存
[root@centos7 yum.repos.d]# yum makecache
6.列出所有已配置的yum仓库
[root@centos7 ~]# yum repolist all