How does ubuntu recover from failure to upgrade glibc

background

The system is ubuntu16.04, recklessly upgraded glibc, and set the prefix to /usr, which caused the system to completely crash, and any operation was invalid, and then restarted. After restarting, the system could not be entered, and the recovery mode could not be entered.

solution

  1. Use other computers to make an ubuntu16.04 installation disk, it is recommended to use the ubuntu server version;
  2. Start the host from the installation disk, and select rescue mode (server version) or trial mode (desktop version) when selecting the startup mode;
  3. Use the mount command to mount the original hard disk. As for how to determine the drive letter of the original hard disk and how to mount it, search by yourself;
  4. Use find or whereis or locate to view the location of libc.so, then use ls -l to view these locations in turn, and use ln -sf SOURCE TARGET to change the soft link pointing to the upgraded libc to the location of the original version of libc.so ;
  5. After the modification is completed, you can use chroot to modify the root boot point to the original hard disk and try to start;
  6. Restart the system, note that you must first enter GRUB when restarting for the first time (press and hold shift when booting), select recovery mode, and after a successful startup, restart again and it will be normal. Otherwise, the modified soft link may become invalid.

How to check glibc version

Method 1: Run /lib/x86_64-linux-gnu/libc.so.6 directly
Method 2: Run ldd --version

Guess you like

Origin blog.csdn.net/liuqixuan1994/article/details/116483161