服务器上编译glibc2.29版本导致命令不能用
bash
Inconsistency detected by ld.so: dl-call-libc-early-init.c: 37: _dl_call_libc_early_init: Assertion `sym != NULL' failed!
下面是造成不可用的原因
bash
1.编译完gcc 2.29版本后,开始做映射,以达到能使用最新版本的glibc
wget -4c https://ftp.gnu.org/gnu/glibc/glibc-2.29.tar.gz
tar -zxvf glibc-2.29.tar.gz
cd glibc-2.29
mkdir build_dir
cd build_dir
sudo ../configure --prefix=/opt/glibc
`编译完后 我映射到/opt/glibc目录下`
[root@localhost ld.so.conf.d]# echo "/opt/glibc/lib" | sudo tee -a /etc/ld.so.conf.d/glibc-2.29.conf
[root@localhost etc]# cd /etc/ld.so.conf.d/
[root@localhost ld.so.conf.d]# ls
glibc-2.29.conf
`更改环境变量`
[root@localhost ld.so.conf.d]# export LD_LIBRARY_PATH=/opt/glibc/lib:$LD_LIBRARY_PATH
`做映射`
[root@localhost ld.so.conf.d]# cat glibc-2.29.conf
/opt/glibc/lib
/opt/glibc-2.29/lib
/opt/glibc-2.29/lib
/opt/glibc/lib
`刷新`
[root@localhost ld.so.conf.d]# ldconfig
`刷新后便不能使用正常的命令了`
[root@localhost app]# ls
Inconsistency detected by ld.so: dl-call-libc-early-init.c: 37: _dl_call_libc_early_init: Assertion `sym != NULL' failed!
恢复可用的方式
bash
[root@localhost ld.so.conf.d]# export LD_LIBRARY_PATH=""
[root@localhost ld.so.conf.d]# echo "" > /etc/ld.so.conf.d/glibc-2.29.conf
`刷新`
[root@localhost ld.so.conf.d]# ldconfig
至此: 服务器又可用了