CentOS6.8升级glibc2.14到glibc2.17

由于开发环境的需要,现在要把glibc2.14升级到2.17,曾经尝试了多种方法,遇到过N多坑,有一次居然把服务器搞得不能启动了,究其原因,是因为升级完glibc后,所有的系统命令都不能使用了,搞得非常郁闷。

痛定思痛之后,换了一种方法,居然发现不用那么折腾,现在记录如下:

1、首先安装必要的库:

# yum install -y gcc

2、查看现有glibc版本:

# ldd --version
ldd (GNU libc) 2.12
Copyright (C) 2010 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.
Written by Roland McGrath and Ulrich Drepper.

3、查看现有系统包中能安装的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_PRIVATE

可见,Centos6能够支持的最高版本也就是2.12了,所以,必须要到官网下载2.17版本手动进行安装了。

4、安装Glibc2.17:

# wget https://ftp.gnu.org/gnu/glibc/glibc-2.17.tar.gz
# tar –zxvf glibc-2.17.tar.gz
# cd glibc-2.17
# mkdir build
# cd build
# ../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
# make –j4
# make install

5、查看安装后的glibc版本:

# ldd --version
ldd (GNU libc) 2.17
Copyright (C) 2012 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.
Written by Roland McGrath and Ulrich Drepper.

PS:之前安装失败的原因,目前不明确,而导致的结果却是致命的,所以,建议大家在升级glibc之前,务必要备份好重要数据。

猜你喜欢

转载自blog.csdn.net/apanious/article/details/81296817
今日推荐