# 操作1、安装SCL源相关软件包

yum install -y centos-release-scl \
centos-release-scl-rh

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

# 操作2、检查.repo文件

# 检查/etc/yum.repos.d/目录下是否存在与SCL相关的.repo文件
# 通常会有CentOS-SCLo-scl.repo和
# CentOS-SCLo-scl-rh.repo两个文件

ls /etc/yum.repos.d

在这里插入图片描述

# 操作3、配置SCL国内源

# 编辑CentOS-SCLo-scl.repo,将[centos-sclo-sclo]的baseurl修改为国内镜像源的地址

[centos-sclo-sclo]
name=CentOS-7 - SCLo sclo
baseurl=https://mirrors.aliyun.com/centos/7/sclo/x86_64/sclo/
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo

# 编辑CentOS-SCLo-scl-rh.repo文件,将[centos-sclo-sclo]的baseurl修改为国内镜像源的地址

[centos-sclo-rh]
name=CentOS-7 - SCLo rh
baseurl=https://mirrors.aliyun.com/centos/7/sclo/x86_64/rh/
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo

在这里插入图片描述
在这里插入图片描述

# 操作4、刷新yum缓存

yum clean all && yum makecache && yum repolist

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

# 操作5、将 CentOS 7 的官方 GPG 公钥导入到 RPM 数据库中

# 这个公钥用于验证来自 CentOS 7 官方仓库的软件包的签名
# 导入公钥后,在执行 yum install 或 yum update 命令就不会遇到
# 关于缺少公钥的警告
# CentOS 7 的官方 GPG 公钥一般存放在/etc/pki/rpm-gpg/

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

# 操作6、更新系统软件包索引

yum update -y

在这里插入图片描述
在这里插入图片描述

# 操作6、验证SCL的国内源是否配置成功

yum install -y vim

在这里插入图片描述

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐