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*

 

posted on 2020-12-16 01:32  项希盛  阅读(8146)  评论(1编辑  收藏  举报