首页 > 系统相关 >centos6报错ls: error while loading shared libraries: libc.so.6: cannot open shared object file

centos6报错ls: error while loading shared libraries: libc.so.6: cannot open shared object file

时间:2023-02-01 11:33:42浏览次数:43  
标签:loading libc so 报错 so.6 shared 2.12

生产环境由于误删了libc-2.12.so和libc.so.6文件导致报错如下:

centos6报错ls: error while loading shared libraries: libc.so.6: cannot open shared object file_环境变量

现在复现此过程:

1.移除这2个文件

mv libc-2.12.so libc.so.6  /opt/

此时再次执行命令就会报错,错误信息如下:

ls: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory

2.解决办法

(1).设置环境变量
export LD_PRELOAD="/opt/libc-2.12.so"
(2).然后把库给链接回来
ln -s /opt/libc-2.12.so /lib64/libc.so.6

centos6报错ls: error while loading shared libraries: libc.so.6: cannot open shared object file_误删_02

此时再次执行命令就可以正常操作了

centos6报错ls: error while loading shared libraries: libc.so.6: cannot open shared object file_误删_03


标签:loading,libc,so,报错,so.6,shared,2.12
From: https://blog.51cto.com/u_13753753/6030986

相关文章