CentOS8更换国内YUM源
rm -rf /etc/yum.repos.d/* wget -O /etc/yum.repos.d/CentOS-cnnic.repo https://feieryun.oss-cn-zhangjiakou.aliyuncs.com/linux/etc/yum.repos.d/CentOS-cnnic.repo
这里是阿里云的源
wget -O /etc/yum.repos.d/CentOS-aliyun.repo http://mirrors.aliyun.com/repo/Centos-8.repo
安装EPEL的方法,首先正常安装源
yum install epel-release
也可以是这样
yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
但EPEL安装之后,还需要批量替换源站(重点在这里)
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*
本文来自博客园,作者:项希盛,转载请注明原文链接:https://www.cnblogs.com/xiangxisheng/p/14141899.html