参考其它:

系统环境:centos6
1、需要升级版本libc,误操作导致的

libc.so.6: cannot open shared object file 报错处理方法

2、执行命令都是报错:

[root@localhost ~]# ll
ls: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
[root@localhost ~]# ls
ls: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory

3、重新建软连接、恢复正常

LD_PRELOAD=/lib64/libc-2.15.so ln -s /lib64/libc-2.15.so /lib64/libc.so.6

4、原理说明
LD_PRELOAD解决的原理是:linux调用so的库文件时,搜素路径为当前路径,再是系统lib目录。但是提供了一个LD_PRELOAD系统变量来改变这个顺序。搜素路径为: LD_PRELOAD ,当前路径,再是系统lib目录