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*

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM