CentOS 8默认自带的资源库在国外,想要下载相关资源非常缓慢或者需要翻墙,为了便捷地使用yum下载安装资源,需要将资源库切换到国内的镜像服务器上。
- 备份原镜像资源库
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
- 下载新的CentOS-Base.repo 到/etc/yum.repos.d/
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
- 若wget命令不可用,则需要先安装wget工具包
yum install wget
- 使用grouplist命令确认镜像源切换是否成功,若正常显示可安装的环境组,则表明镜像源切换成功
yum grouplist