Fix /bin/bash missing!

I suffered for 3 days. So now I will make a tutorial for other people so they don’t suffer!

My situation: I tried to install libc6:1386. Big mistake. Erases all things related to libc6:arm64. Including Bash.

Why is bash so important? Well if you don’t have bash- You can’t login (without it rebooting unless your other account is using /bin/sh).

The Fix is: (IW, and other configs don’t work- so give up on those-)

  1. Go to the FTP repository for Debian on a seperate computer, download bash for bullseye and all its dependencies! (Suffering)

  2. Put them all on a USB drive!

  3. Add init=/bin/sh to your boot cmdline.txt on a seperate computer

  4. Boot up DietPi.

  5. Run # mount -o remount,rw /dev/mmcblk0p2 /
    (Mounts main partition (mmcblk0p2) to / (so you can edit files).

6.Plug that usb in! If it doesn’t say sd[a,b,c, etc.] Run # dmesg > dmesg.txt
(Cuz you can Vim text files but can’t scroll in Bourne shell).

  1. mkdir /mnt/usb

Mount /dev/sd[that letter you got earlier] /mnt/usb

  1. Now for whatever awful reason you can’t write to the usb so cp those files to somewhere on your machine.

  2. Cd to the folder with the files and # dpkg -i [package-name-version]_arm64.deb

  3. Now reboot and login! See the magic! Run apt and run the apt fix command it shoves back at you!

Thanks for the suffering Bourne Again SHell! See ya lata!