哈特中尉's Blog

不会写代码的司机不是好厨师!

centos7升级glibc

查看linux内核

uname -r
4.12.1-1.el7.elrepo.x86_64

查看centos版本

lsb_release -a

command not found 解决方法:
yum install redhat-lsb -y

下载安装包(清华大学开源软件镜像站)

1
2
3
4
5
6
7
wget https://mirrors.tuna.tsinghua.edu.cn/gnu/glibc/glibc-2.20.tar.gz
tar -zxvf glibc-2.20.tar.gz
mkdir glibcbuild
cd glibcbuild
../glibc-2.20/configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
make
make install

成功则提示:Your new glibc installation seems to be ok.

2.26安装失败

2.26版本 执行configure的时候出现如下错误,查阅资料好像需要先升级gcc,再升级glibc。
保险起见,没有升级gcc,就用2.20版本了。

1
2
3
4
5
6
7
checking if gcc -B/usr/bin/ is sufficient to build libc... no
checking for nm... nm
checking for python3... no
checking for python... python
configure: error:
*** These critical programs are missing or too old: compiler
*** Check the INSTALL file for required versions.