删除符号链接libc.so.6后如何恢复? [英] How to recover after deleting the symbolic link libc.so.6?

查看:330
本文介绍了删除符号链接libc.so.6后如何恢复?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的服务器中,到libc.so.6的符号链接已被删除.现在,系统中的所有二进制文件都不起作用.为了解决这个问题,我尝试:

In our server the symbolic link to libc.so.6 has been deleted. Now none of the binaries in the system work. To fix this, I tried:

/bin/ln -s /lib/libc-2.11.3.so /lib/libc.so.6

如预期的那样,它给了我

which, as expected, gives me:

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

我也尝试过:

/lib/ld-linux-x86-64.so.2  --inhibit-rpath /lib/libc.so.6 \
   --library-path /lib/libc-2.11.3.so \
   /bin/ln -s /lib/libc-2.11.3.so /lib/libc.so.6

具有相同的结果.进一步失败的尝试包括cp,mv,cat.

with the same result. Further unsuccessful attempts include cp, mv, cat.

我通过ssh连接,并且我相信在关闭该会话后将无法打开另一个会话.有没有办法修复此系统(也许使用bash内置程序)?

I'm connected via ssh and I believe I will not be able to open another session after closing this one. Is there a way to fix this system (using bash built-ins perhaps)?

[编辑]我做到了:

while read line; do echo $line; done < /lib/libc-2.11.3.so > libc.so.6

复制文件并尝试:

/lib/ld-linux-x86-64.so.2  --inhibit-rpath libc.so.6 --library-path . \
  /bin/ln -s /lib/libc-2.11.3.so /lib/libc.so.6

得到了:

/bin/ln: error while loading shared libraries: ./libc.so.6: ELF file OS ABI invalid

推荐答案

您可以简单地运行ldconfig.大多数发行版都将其作为静态二进制文件发送.

You could simply run ldconfig. Most distributions ship this as a static binary.

这篇关于删除符号链接libc.so.6后如何恢复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆