centos7下升级GLIBC2.31

先决条件:
升级gcc9.3.0
升级make4.3

查看当前系统版本即GLIBC信息
$ cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)

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

1,编译升级gcc
$ wget https://mirrors.aliyun.com/gnu/gcc/gcc-9.3.0/gcc-9.3.0.tar.gz
$ tar -zxvf gcc-9.3.0.tar.gz
$ cd gcc-9.3.0/
$ ./contrib/download_prerequisites
$ cat /proc/cpuinfo| grep “processor”| wc -l
$ mkdir build
$ cd build
$ …/configure --enable-checking=release --enable-language=c,c++ --disable-multilib --prefix=/usr
$ make -j6
$ make install
升级后gcc版本检查
$ gcc --version
gcc (GCC) 9.3.0
Copyright © 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

2,编译升级make
$ wget https://mirrors.aliyun.com/gnu/make/make-4.3.tar.gz
$ tar -zxf make-4.3.tar.gz
$ mkdir build
$ cd build
$ …/configure --prefix=/usr && make && make install
检查升级后make版本信息
$ make -v
GNU Make 4.3
Built for x86_64-pc-linux-gnu
Copyright © 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

3,升级glibc-2.3.1
$ wget https://mirrors.aliyun.com/gnu/glibc/glibc-2.31.tar.gz
$ tar -zxf glibc-2.31.tar.gz
$ cd glibc-2.31/
$ cat INSTALL | grep -E “newer|later”
$ mkdir build
$ cd build
$ …/configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin --disable-sanity-checks --disable-werror

yum install python3 //如果编译时出现报错可能时python版本过低,升级一下重新编译即可

$ make -j6
$ make install
$ make localedata/install-locales

最后验证升级后的glibc版本
$ strings /lib64/libc.so.6 | grep GLIBC
GLIBC_2.2.5
GLIBC_2.2.6
GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_2.4
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
GLIBC_2.8
GLIBC_2.9
GLIBC_2.10
GLIBC_2.11
GLIBC_2.12
GLIBC_2.13
GLIBC_2.14
GLIBC_2.15
GLIBC_2.16
GLIBC_2.17
GLIBC_2.18
GLIBC_2.22
GLIBC_2.23
GLIBC_2.24
GLIBC_2.25
GLIBC_2.26
GLIBC_2.27
GLIBC_2.28
GLIBC_2.29
GLIBC_2.30

原文链接:https://blog.csdn.net/weixin_46309058/article/details/122700636

你可能感兴趣的:(linux,运维,服务器)