问题表象:
#原系统centos6.9自带GLIBC_2.12,安装一些软体提示版本不对,决定升级。
ImportError: /lib64/libc.so.6: version `GLIBC_2.17' 问题解决
方法一:
CentOS6.x升级 glibc
gcc -v 查看gcc版本
ldd --versio 查看glibc版本
下面是个脚本,可以复制到一个文件中,执行即可。执行完之后,使用ldd --version查看glibc版本,是否已经升级到2.17
也可以将下面脚本中的五条命令依次copy出来放在命令行中执行,执行完后检查glibc版本#
! /bin/sh
# update glibc to 2.17 for CentOS 6
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-common-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-devel-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-headers-2.17-55.el6.x86_64.rpm
sudo rpm -Uvh glibc-2.17-55.el6.x86_64.rpm glibc-common-2.17-55.el6.x86_64.rpm
glibc-devel-2.17-55.el6.x86_64.rpm glibc-headers-2.17-55.el6.x86_64.rpm --force --nodeps
方法二:
.
wget http://ftp.gnu.org/gnu/glibc/glibc-2.17.tar.gz
tar -xvf 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 -j 8
make install
#安装完成后,查看版本
ldd --version
出现 ldd (GNU libc) 2.17,表示安装成功。