centos更换阿里镜像及SCL更换数据源
- 买买缇
- 2024-07-06
1、更换yum镜像
# 1. 首先备份你的yum仓库配置
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
# 2. 更新仓库配置(以CentOS 7为例)
# 下载最新的CentOS 7仓库配置
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
2、修改CentOS-SCLo-scl.repo
vi /etc/yum.repos.d/CentOS-SCLo-scl.repo
修改此部分的baseurl
[centos-sclo-sclo]
name=CentOS-7 - SCLo sclo
baseurl=https://mirrors.aliyun.com/centos/7/sclo/x86_64/sclo/
# mirrorlist=http://mirrorlist.centos.org?arch=$basearch&release=7&repo=sclo-sclo
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
3、修改CentOS-SCLo-scl-rh.repo
vi /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
修改此部分的baseurl
[centos-sclo-rh]
name=CentOS-7 - SCLo rh
baseurl=https://mirrors.aliyun.com/centos/7/sclo/x86_64/rh/
# mirrorlist=http://mirrorlist.centos.org?arch=$basearch&release=7&repo=sclo-rh
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
4、刷新缓存
yum repolist
yum clean all
yum makecache
侧边栏