CentOS7
curl -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.huaweicloud.com/repository/conf/CentOS-7-anon.repo > Centos-7.repo
CentOS8
curl -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.huaweicloud.com/repository/conf/CentOS-8-anon.repo > Centos-8.repo
CentOS9
curl -O https://repo.huaweicloud.com/repository/conf/CentOS-9-anon.repo > Centos-9.repo
epel
yum install -y epel-release
执行yum clean all
清除原有yum
缓存
执行yum makecache
(刷新缓存)或者yum repolist all
(查看所有配置可以使用的文件,会自动刷新缓存)。