CentOS下glibc升级
默认的Centos6.8 glibc版本最高为2.12,而在进行Nodejs开发时项目所依赖的包往往需要更高版本的glibc库支持,因此在不升级系统的前提下,需要主动更新系统glibc库,一般遇到错误libc.so.6: version GLIBC_2.14 not found时表示需要对glibc进行升级了。
strings /lib64/libc.so.6|grep GLIBC_
从此图可以看出系统最高支持glibc的2.12版本
从glibc官网(http://ftp.gnu.org/gnu/glibc)下载源码包:http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
tar zxf glibc-2.14.tar.gz
cd glibc-2.14/
mkdir build
../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
make && make install
Execution of gcc failed! The script has found some problems with your installation! Please read the FAQ and the README file and check the following: - Did you change the gcc specs file (necessary after upgrading from Linux libc5)? - Are there any symbolic links of the form libXXX.so to old libraries? Links like libm.so -> libm.so.5 (where libm.so.5 is an old library) are wrong, libm.so should point to the newly installed glibc file - and there should be only one such link (check e.g. /lib and /usr/lib) You should restart this script from your build directory after you've fixed all problems! Btw. the script doesn't work if you're installing GNU libc not as your primary library! make[1]: *** [install] Error 1 make[1]: Leaving directory `/usr/src/glibc' make: *** [install] 错误 2 |
出现此报错,但升级glibc还是成功的。
ll /lib64/libc.so.6
lrwxrwxrwx 1 root root 12 Jun 2502:07 /lib64/libc.so.6 -> libc-2.14.so |