CentOS8 更换阿里yum源
1 查看 epel.repo信息
cd /etc/yum.repos.d/cat epel.repo2 配置epel 配置包
yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm3 查看 epel.repo信息
cd /etc/yum.repos.d/cat epel.repo4 备份原有的源
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backupmv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup5 安装CentOS-8.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo6 将repo 配置中的地址替换为阿里云镜像站地址
sed -i 's|^#baseurl=https://download.fedoraproject.org/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*7 列出所有的yum repo
yum repolist8 清除yum 缓存
yum makecache9 查看源
cd /etc/yum.repos.d/cat CentOS-Base.repocat CentOS-AppStream.repocat CentOS-Extras.repo