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