安装 GLIBC_2.14

1、查看系统glibc支持的版本

 

# strings /lib64/libc.so.6 |grep GLIBC
# rpm -qa | grep glibc

2、升级glibc支持的版本到GLIBC_2.14

官网地址 ➡️ http://www.gnu.org/software/libc/
官网所有安装包 ➡️ http://ftp.gnu.org/gnu/glibc/

 

# cd /usr/local
# wget http://ftp.gnu.org/gnu/libc/glibc-2.14.tar.xz
# tar -xvf glibc-2.14.tar.xz
# mkdir -p /var/VMdisks
# mv glibc-2.14 /var/VMdisks/
# cd /var/VMdisks/glibc-2.14/
# mkdir build && cd build/
# ../configure --prefix=/usr/local/glibc-2.14
# make -j4
# make install
--- 解决中文乱码问题
# make localedata/install-locales

临时修改环境变量

 

# export LD_LIBRARY_PATH=/usr/local/glibc-2.14/lib:$LD_LIBRARY_PATH
# echo $LD_LIBRARY_PATH

修改/lib64/libc.so.6的软链接来源,由之前的libc-2.12.so修改为libc-2.14.so

 

# cd /lib64
# ll libc.so.6
# ll /usr/local/glibc-2.14/lib/libc-2.14.so
# cp /usr/local/glibc-2.14/lib/libc-2.14.so /lib64/
# unlink /lib64/libc.so.6

如果上面删除命令执行后,导致该机器的很多shell命令无法执行!甚至于机器无法登陆!报错如下:
error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
注意:千万不要关闭当前的终端窗口,因为此时机器可能无法登陆了。只能在当前终端窗口下进行紧急修复:

 

# ldconfig

然后做/lib64/libc.so.6新的软链接,软链接到libc-2.14.so

 

# ln -s libc-2.14.so /lib64/libc.so.6
# ll libc.so.6
--- 查看系统glibc支持的版本
# strings /lib64/libc.so.6 |grep GLIBC

3、升级glibc挂了后可以救命的命令

如果实在不幸,在升级glibc时挂掉了,执行各种命令都提示错误,比如:

  • Segmentation fault
  • error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
    这类错误出现千万不要着急退出SSH,执行下面的命令是可以挽救的:

 

# cd /lib64
# LD_PRELOAD=/lib64/libc-2.12.so ln -sf /lib64/libc-2.12.so libc.so.6

Tips:libc-2.12.so这个文件名根据你系统中的文件而定,如果有多个版本so文件可以逐个尝试

 

安装过程报错汇总

1.make语句报错

checking LD_LIBRARY_PATH variable... contains current directory
configure: error: 
*** LD_LIBRARY_PATH shouldn t contain the current directory when
*** building glibc. Please change the environment variable
*** and run configure again.

解决方案:

export LD_LIBRARY_PATH=/public/software/mpi/openmpi-16-intel/lib:/public/software/intel/composer_xe_2011_sp1.7.256/compiler/lib/intel64:/public/software/intel/composer_xe_2011_sp1.7.256/mkl/lib/intel64:/opt/gridview/pbs/dispatcher427/lib:/usr/local/lib64:/usr/local/lib

 

问题2:
configure文件没有执行权限:
解决方法:
[root@localhost build]# chmod +r ../configure
问题3:
make: execvp: /home/harshilsharma63/llvm/autoconf/mkinstalldirs: Permission denied
make: *** [install-local] Error 127
harshilsharma63@ubuntu:~/llvm$ sudo make install
llvm[0]: Installing include files
make: execvp: /home/harshilsharma63/llvm/autoconf/mkinstalldirs: Permission denied
make: *** [install-local] Error 127

解决办法:[root@localhost build]# chmod +x ../scirpts/mkinstalldirs
```
问题4:
execv: Permission denied
/usr/src/glibc-build/sunrpc/rpcgen: C preprocessor failed with exit code 1
make[2]: *** [/usr/src/glibc-build/sunrpc/xbootparam_prot.stmp] Error 1
make[2]: *** Leaving directory `/usr/src/glibc-2.2.5/sunrpc'
make[1]: *** [sunrpc/others] Error 2
make[1]: *** Leaving directory `/usr/src/glibc-2.2.5'
make: *** [all] Error 2
=== END ===
解决办法:
[root@localhost build]# make clean
[root@localhost build]# chmod +x ../scripts/cpp

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值