1.备份本地yum源
[root@localhost Desktop]# cd /etc/yum.repos.d/ [root@localhost yum.repos.d]# mv /etc/yum.repos.d/CentOS-Linux-BaseOS.repo /etc/yum.repos.d/CentOS-Linux-BaseOS.repo.backup
2.获取阿里yum源配置文件
[root@localhost yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Linux-BaseOS.repo http://mirrors.aliyun.com/repo/Centos-8.repo
3.更新yum缓存
[root@localhost yum.repos.d]# yum makecache
4.查看当前yum源
[root@localhost yum.repos.d]# yum repolist