The solution to the unusable linux command, no need to reinstall the system!

Original address: http://blog.csdn.net/dxmgood/article/details/9822433

 

Phenomenon:

When operating the linux system, sometimes most of the commands except cd (ls, ll, ln, rm, mkdir, etc.) cannot be used, and cannot ssh from other machines or log in through other ssh clients.


reason:

It should have accidentally affected the most important libc.so.6 of the linux shell, which is a dynamic link library, which actually points to libc-2.1... or something, it may be wrong. So most shell commands cannot be used.


Solution:

First use export LD_PRELOAD=libc-2.11...so. (I can't remember what is after 2.11. If you are not sure, you can use cd /lib64/libc-2, press the tab key twice to associate, see what your machine has Corresponding library), and then under this console (be careful not to close this dialog), you can use all shell commands, and then use ln - f s libc-2.1... libc.so.6, which creates a new libc .so.6, then the machine is back to normal. It should be noted that you must use f, that is, force, to force the establishment of a symbolic link, otherwise it cannot be established, and it will prompt that the symbolic link already exists.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326991697&siteId=291194637