CentOS 升级 Glibc-2.28

安装 glibc-2.28

复制代码
# 下载并解压 glibc-2.28
$ wget https://ftp.gnu.org/gnu/glibc/glibc-2.28.tar.gz
$ tar -xzvf glibc-2.28.tar.gz
$ cd glibc-2.28
# 创建临时文件
$ mkdir build && cd build
$ ../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin

# 这一步时, 发生了错误, 提示大致为
These critical programs are missing or too old: make compiler

升级make

复制代码
$ wget https://ftp.gnu.org/gnu/make/make-4.3.tar.gz
$ tar -xzvf make-4.3.tar.gz 
$ cd make-4.3/
# 安装到指定目录
$ ./configure  --prefix=/usr/local/make
$ make
$ make install
# 创建软链接
$ cd /usr/bin/
$ mv make make.bak # backup
$ ln -sv /usr/local/make/bin/make /usr/bin/make

升级gcc(如果找不到安装包,则添加yum源,继续看文档)

复制代码
# 直接安装 GCC-8
$ yum install -y devtoolset-8-gcc devtoolset-8-gcc-c++ devtoolset-8-binutils
# 设置环境变量
$ echo "source /opt/rh/devtoolset-8/enable" >> /etc/profile
$ source /etc/profile

解决安装devtoolset-8找不到包的情况,添加yum源

复制代码
# 添加yum源
vi /etc/yum.repos.d/CentOS-SCLo-scl.repo
[centos-sclo-sclo]
name=CentOS-7 - SCLo sclo
baseurl=http://mirror.centos.org/centos/7/sclo/$basearch/rh/
#mirrorlist=http://mirrorlist.centos.org?arch=$basearch&release=7&repo=sclo-sclo
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo

升级完gcc和make之后,继续编译glibc

#验证是否安装成功

$ strings /lib64/libc.so.6 | grep GLIBC

相关推荐
EMTime8 小时前
Docker运行OpenWRT
运维·docker·容器
lolo大魔王9 小时前
Linux 文件系统超全面详解(原理、结构、挂载、分区、inode、日志、管理命令)
linux·运维·服务器
磊 子10 小时前
详细讲解一下epoll
linux·io·epoll·io多路复用
printfLILEI11 小时前
php中的类与对象以及反序列化
linux·开发语言·php
zyl8372111 小时前
Docker 使用手册
运维·docker·容器
古月方枘Fry12 小时前
MGRE实验
运维·服务器
叠叠乐12 小时前
redmi k90 pro max 强解BL,刷海外rom, 并刷入sukisu ultra
linux
stolentime12 小时前
FreeDomain 本地开发环境快速搭建指南
运维·服务器·网络
xiaoye-duck13 小时前
《Linux系统编程》Linux 进程间通信之管道基础解析:从匿名管道原理到基于管道的进程池实现
linux