一、备份repo文件
mkdir ~/yum.repos.bak
mv /etc/yum.repos.d/* ~/yum.repos.bak/
二、导入aliyun repo
cd /etc/yum.repos.d
curl -o CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# CentOS 7
curl -o CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
# CentOS 8
三、安装ELRepo
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
yum install -y https://www.elrepo.org/elrepo-release-7.0-4.el7.elrepo.noarch.rpm
# CentOS 7
yum install -y https://www.elrepo.org/elrepo-release-8.1-1.el8.elrepo.noarch.rpm
# CentOS 8
四、刷新yum缓存
yum clean all && yum makecache
Comments 1 条评论
博主 一个学金融的文史哲小生
Centos是Linux系统里最折腾的神!~
我不接受反驳,这是事实!