仅适用于Centos8
-
cd /etc/yum.repos.d/
-
备份 cp CentOS-Linux-AppStream.repo CentOS-Linux-AppStream.repo-bak
cp CentOS-Linux-BaseOS.repo CentOS-Linux-BaseOS.repo-bak
cp CentOS-Linux-Extras.repo CentOS-Linux-Extras.repo-bak
3.编辑各个文件内容
[AppStream]
name=CentOS-$releasever - AppStream
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra
baseurl=https://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[BaseOS]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
baseurl=https://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[Extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
baseurl=https://mirrors.aliyun.com/centos/$releasever/extras/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
4.reboot重启即可更换到阿里云的源,装个软件不用等半天了。
属实有用 转载了! 仅适用于Centos8
原作者:雪之下残雪出处: → bilibili ←
「真诚赞赏,手留余香」
真诚赞赏,手留余香
使用微信扫描二维码完成支付