0

I'm new to Linux and did something stupid. I'm using Kali and after apt-get update and apt-get upgrade, I encountered some issues. The desktop items were missing and windows no longer had a "bar", along with some other things. While trying to fix that, I messed it up way more..

I found that it was caused by a libGL error where it failed to load the swrast driver.

Someone on this site suggested renaming /usr/lib/x86_64-linux-gnu to /usr/lib/x86_64-linux-gnu.bak which I did with the mv command.

It was stupid to do so without thinking about what that could impact. Now I can no longer run most commands (I will get an error: command_not_found_handler:2: /usr/lib/command-not-found: bad interpreter: /usr/bin/python3: no such file or directory) I'm trying to move the folder back with mv /usr/lib/x86_64-linux-gnu.bak /usr/lib/x86_64-linux-gnu but it results in the same error. So does using BusyBox.

I've tried using ../sbin/sln x_86-64-linux-gnu.bak x_86-64-linux-gnu but it says there is no such file or directory.

Any ideas on what I can try or have I already lost all my data?

3
  • 1
    "Someone on this site" - is that part of a question or answer? If so can you link to it please so it can be checked for accuracy Commented Oct 8, 2024 at 13:27
  • 4
    "I'm new to Linux and did something stupid. I'm using Kali" - Please DO NOT use Kali if you are new to Linux. Use a more friendly distribution while you get used to the environment, and then considering maybe possibly perhaps moving to Kali if you have a security/pentest role. Certainly, don't use Kali as your daily driver Commented Oct 8, 2024 at 13:36
  • What data do you need to recover? You could boot a live Linux system, e.g from an Ubuntu installation media, mount your harddisk and backup the important data. You could also rename the directory to the original name from this live system. Please edit your question to add information. Commented Oct 8, 2024 at 14:45

1 Answer 1

0

You have temporarily screwed up your system by renaming /usr/lib/x86_64-linux-gnu to /usr/lib/x86_64-linux-gnu.bak. Shared libraries (helper tools for programs) are located in /usr/lib/x86_64-linux-gnu ONLY or some other architecture name (not the case), so changing the name of the directory causes those programs, which is almost every program in the system, to not be able to find those shared libraries and abort.

Idea by @Bodo, an easy solution is to boot into a LiveCD (such as Rescuezilla, my personal favorite, a Debian Live ISO, etc.), mount the system to an empty directory such as /mnt, chroot into the “broken” system, and rename the directory INSIDE the chroot'ed environment with mv /usr/lib/x86_64-linux-gnu.bak /usr/lib/x86_64-linux-gnu. Chroot'ing into the system is actually optional (but a bit more prone to mount directory typing mishaps) since the operation is a simple rename, so you can take the path you have mounted the broken drive, /mnt possibly, with /usr/lib/x86_64-linux-gnu.bak and rename that instead.

Steps if the previous paragraph was too concise:

  1. Boot into your favorite LiveCD.
  2. Mount the partition (/dev/sda#, replace # with the partition number) to /mnt with mount /dev/sda# /mnt. The correct partition can be identified by using lsblk. There is no harm with choosing the wrong partition since it can be unmounted with umount /dev/sda#.
  3. chroot'ing is optional, but you can use chroot /mnt, mv /usr/lib/x86_64-linux-gnu.bak /usr/lib/x86_64-linux-gnu to change the directory name, and exit to exit the chroot environment, and you are done.
  4. If you do not want to chroot, simply execute mv /mnt/usr/lib/x86_64-linux-gnu.bak /mnt/usr/lib/x86_64-linux-gnu and you are done. Unmounting is optional but recommended, so you can do that with umount /dev/sda#.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.