更新GCC版本问题处理(Could not resolve host: mirrorlist.centos.org;)更换SCL配置源/SCL后yum使用不了

发布于:2024-07-08 ⋅ 阅读:(57) ⋅ 点赞:(0)

SCL:

在 Linux 系统中,更新 GCC(GNU Compiler Collection)编译器需要使用 Software Collections (SCL) 库的原因主要有以下几点:

https://wiki.centos.org/AdditionalResources/Repositories/SCLicon-default.png?t=N7T8https://wiki.centos.org/AdditionalResources/Repositories/SCL

1.版本隔离:

SCL 允许在同一系统上安装和使用多个版本的软件包,而不会影响系统的主要版本。这对于需要特定版本的编译器的开发工作非常有用,因为它可以避免与系统自带的编译器版本冲突。

2.兼容性:

有时候,系统自带的 GCC 版本可能太旧,无法满足某些开发需求,特别是当需要使用最新的编译器特性或修复旧版本中的问题时。SCL 提供了一种方式来安装和使用较新版本的 GCC,同时保持系统稳定性和兼容性。

3.易于管理:

使用 SCL,可以轻松地安装、切换和卸载不同版本的 GCC。

4.软件包集合:

SCL 不仅提供 GCC,还提供了一系列相关的开发工具和库。这意味着可以通过 SCL 安装一个完整的开发环境,包括编译器、调试器和性能分析工具等。

5.官方支持:

SCL 是由 Red Hat 官方提供的,因此它经过了严格的测试和验证,可以确保软件包的质量和稳定性。

问题复现:

在启动 RedisInsight 服务时候,发现如下报错:

[101864] Error loading Python lib '/tmp/_MEIqiNOAl/libpython3.10.so.1.0': dlopen: 
/lib64/libm.so.6: version `GLIBC_2.29' not found (required by 
/tmp/_MEIqiNOAl/libpython3.10.so.1.0)

这个错误信息表明在尝试加载一个 Python 库时遇到了问题,具体是 `/tmp/_MEIokXyW1/libpython3.10.so.1.0` 这个库文件。

错误的原因是系统缺少这个库文件所需的 GLIBC_2.29 版本的 `libm.so.6` 库。`libm.so.6` 是一个数学库,属于 GNU C 库(glibc)的一部分。
要解决这个问题,需要更新 glibc 库到至少是 2.29 版本;

[root@master ~]# yum -y install centos-release-scl 

安装 centos-release-scl 后,将能够访问 SCL 仓库,并安装 SCL 提供的软件包,但是在进行下一步安装 Development Toolset 8时候发现,yum无法使用:

Could not retrieve mirrorlist http://mirrorlist.centos.org?arch=x86_64&release=7&repo=sclo-rh error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误"


 One of the configured repositories failed (未知),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer

没有魔法,无法直连外网;所以需要修改为centos-release-scl ;centos-release-scl-rh的国内源;

CentOS-SCLo-scl.repo

[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-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

[root@master yum.repos.d]# yum repolist && yum clean all && yum makecache

尝试下载;成功


网站公告

今日签到

点亮在社区的每一天
去签到