1

I accidently moved my /usr/bin/ folder to Downloads using the following command.

sudo mv /usr/bin/ Downloads/

I saw a similar problem like this here

But that doesnot work, because I don't have access to my terminal. Any idea how to solve this?

1 Answers1

2

The gist is simple. Boot a live USB, mount the system partition, and fix it. Now, here's how to actually do it:

  1. Make a live USB. Directions are here (go to the section titled "Creating a Ubuntu LiveCD" and do that) if you don't know how. If you don't already have a live USB (a.k.a. the installation USB stick) you will need to make one from a different machine.
  2. Boot to the live USB, and do "Try Ubuntu"
  3. Open a terminal - I don't use Ubuntu much anymore, so maybe someone else can edit in the name of the terminal app on Ubuntu)
  4. Identify the main system partition. I'll use /dev/sda1 as my example, but use the correct one for you. You can identify it with lsblk (run that in the terminal).
  5. Mount the system partition somewhere (e.g., /mnt). Do sudo mount /dev/sda1 /mnt.
  6. Double-check that ls /mnt contains the root direcory of your main OS. If it doesn't, find out where you messed up and fix it
  7. Do sudo mv /mnt/home/[you]/Downloads/bin /mnt/usr. Replace [you] with your username on your real system. Done!
  8. Do sudo umount /mnt to unmount your system partition
  9. Do sudo shutdown now to turn off the live USB, unplug it, and when you turn your computer on again, it should work
cocomac
  • 3,824