316 字
2 分钟
Centos升级glibc2.28遇到的坑
起因
最近在使用某程序的时候需要高版本的glibc,升级系统成本太高,遂改为研究升级glibc版本。
升级过程
查询glibc版本:
strings /lib64/libc.so.6 | grep -E "^GLIBC" | sort -V -r | uniq下载2.28版本并编译:
wget https://ftp.gnu.org/gnu/glibc/glibc-2.28.tar.gztar -xzvf glibc-2.28.tar.gzcd glibc-2.28mkdir build && cd build../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/binmake安装:
make install>查询是否升级成功:
strings /lib64/libc.so.6 | grep GLIBC过程中遇到的坑
第一个坑
../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和compiler版本太低,需要进行升级
升级make:
wget http://ftp.gnu.org/pub/gnu/make/make-4.4.tar.gztar -xzvf make-4.4.tar.gzcd make-4.4/mkdir build&&cd build../configure --prefix=/usr/bash build.shmake install验证:
make --version升级compiler:
yum -y install centos-release-sclyum -y install devtoolset-8-gcc devtoolset-8-gcc-c++ devtoolset-8-binutilsscl enable devtoolset-8 bashecho "source /opt/rh/devtoolset-8/enable" >>/etc/profile验证:
gcc --version第二个坑
make和compiler都升级成功之后继续执行glibc升级代码,make之后开始漫长的编译,N久之后发现没动了 卡在了:
make[2]: Entering directory '/root/glibc-2.28/stdio-common等待半天无果,强制中断重新make,问题依然复现,重新下载glibc2.28依然不行。
后发现问题出在make版本过高的原因,glibc2.28版本需要make版本在4.0版本以上且低于4.4版本,遂降级make,一次成功编译。
文章分享
如果这篇文章对你有帮助,欢迎分享给更多人!
Centos升级glibc2.28遇到的坑
https://blog.zwfpro.com/posts/glibc-update/ 最后更新于 2024-05-27,距今已过 877 天
部分内容可能已过时
岁语集