1

screenshot of error message

This happened after last night I was stubborn and sleepy enough to not read that it's best to install the missing dependencies from the var/logs and was lazy enough to just Google and try the first (quick) answer that came up.

I use Debian Gnome Jessie.

The order of was the following:

sudo apt-get remove python

Restart
Gnome not booting, terminal appeared.

cd /var/cache/apt/archives
dpkg --unpack *.deb

Restart

initramfs

Now when I hit exit from initramfs, this appears.

booting to busybox shell

Please help. I have Gnome Live Usb but nothing is working. Initramfs is still showing up.

Yaron
  • 4,289
  • 5
    Removing python from a Linux system will break it. Too many things depend on it. Try using the instructions here (only steps 1-3, just create the chroot) to set up a chroot environment and run sudo apt install python from there. Does that fix it? – terdon May 08 '17 at 12:51
  • It says that python is already the newest version but the following packages have unmet depenendecies. You might want to run 'apt-get -f install' to correct these. Wonderful. Sadly, wireless internet doesn't work in Live Boot. – DerrickCrash May 08 '17 at 13:10
  • Hmm, it should. It might be simpler to use a live Ubuntu CD which is likely to have wireless working out of the box instead. Alternatively, can you use an ethernet cable? Also, are you 100% sure you ran the commands from the chroot environment? The message suggests you ran them from the live session instead. You need to follow the steps I gave and then, from the same terminal as the chroot command, run the apt install. – terdon May 08 '17 at 13:13
  • Terdon, I have followed steps 1,2,3 and I observed that at step 2 (sudo mount --bind) it would not go through and got only a closed bracket (>). Is this normal? It's no problem. I will make a Ubuntu Live USB right away. It's complicated with the internet cables because my router from Virgin Media uses some weird kind of cables. I live in the UK so everything is kind of backwards. – DerrickCrash May 08 '17 at 13:18
  • Ah, yes, you need to copy/paste that entire block of commands directy into the terminal. The > you see is because of the trailing && which is a locial AND connecting each of the mount --bind commands given. If you wantr to run them one by one, don't copy the && but it is simpler to just paste the entire set of 4 lines at once. So, that means you didn't run the apt command from within the chroot environment. However, if you don't have internet access, the point is moot anyway. That's the first thing to sort out. – terdon May 08 '17 at 13:22
  • Oh, I've used Debian for the past year and a half and I've never had problems with what I understood but with undocumented stuff, jeez, it's like using the Enigma Machine. Now I am preparing the Ubuntu Live USB and give it another go. Wish me luck :) – DerrickCrash May 08 '17 at 13:26
  • Um. Nothing is undocumented here. You just didn't read the documentation. :) And you chose to remove an integral part of the OS. . . Anyway, good luck! – terdon May 08 '17 at 13:29
  • Undocumented by me, of course. :) The community is great, this is why I installed it in the first place. – DerrickCrash May 08 '17 at 13:30
  • The wireless on Ubuntu Gnome is not working. What do you recommend using? – DerrickCrash May 08 '17 at 13:34
  • Well, the only one I can think of that might have a higher chance of working out of the box is Linux Mint. You may as well try that. If that still fails, you will need to fix the wireless on the live session. That probably deserves a separate question. If you end up asking it, make sure to include the output of lspci -nn | grep 0280 and exactly what you mean by "not working" (what symptoms you see. e.g. card not recognized at all; no networks shown; can't connect to any network shown etc). – terdon May 08 '17 at 13:38
  • I think that the wireless card isn't recognized. When I go to Network I see only two options: Wired connection and Network Proxy. – DerrickCrash May 08 '17 at 13:43
  • I can't really help much with that. Please post a separate question as suggested above. – terdon May 08 '17 at 13:44
  • Try the following command from initramfs ; fsck /dev/sdaX , replaces sdaX with your root partition then reboot – GAD3R May 08 '17 at 14:05
  • It doesn't work. fsck: error 2(No such file or directory) while executing fsck.ext2 for /dev/sdaX. I will boot with a Linux Mint Live Demo and hope the wireless will work. Guys, if you don't have any other suggestions, I am very grateful for all your time and effort, thank you :) – DerrickCrash May 09 '17 at 15:11
  • Sorry, I replaced sdaX with sdb1 where my root partition is and it's still not working. – DerrickCrash May 09 '17 at 17:19
  • I got the wi-fi working in Debian Jessie. I have created the chroot environment, now I have problem accessing it. root@debian:/etc/apt# sudo chroot /mnt sudo: unable to resolve host debian chroot: failed to run command ‘/bin/bash’: No such file or directory – DerrickCrash May 09 '17 at 21:51

2 Answers2

1

When force removing Python, everything that depends on Python probably also was removed - and that is a lot. I'm pretty sure it warned you of not doing that... and judging from that first screenshot, you may have wiped your system way more than just removing python...

Eitherway, dpkg --unpack is not sufficient to reinstall a package (there is also "install"...), and the cache in /var will only contain recently downloaded files. There may well be some missing.

You can try to do the dpkg thing correctly, but most likely you will still be missing some dependencies.

As for the last error - it just says that you exited process 1. The operating system cannot continue then, process 1 is supposed to launch everything and not exit. No need to further think about it - rather you need to find a way to get your wireless up and the missing packages installed.

If you really intend to do the chroot recovery, first try to understand what you need to mount where. When done correctly, you may be able to do simply apt install python to get python back. First try if the recovery function of the installer can set up the chroot for you... once you have the chroot, inspect the damage first before making it worse...

Remember, chroot is not trivial to set up properly: https://superuser.com/questions/111152/whats-the-proper-way-to-prepare-chroot-to-recover-a-broken-linux-installation

  • I got the wireless running on Debian Jessie and tried to create a environment with chroot where I could fix python and I got this: root@debian:/etc/apt# sudo chroot /mnt sudo: unable to resolve host debian chroot: failed to run command ‘/bin/bash’: No such file or directory – DerrickCrash May 10 '17 at 09:14
  • You don't appear to have understood what "sudo" does... nor what the chroot is for. Did you mount the right partitions? Where is /bin/bash? – Has QUIT--Anony-Mousse May 10 '17 at 19:20
1

One suggestion that might work:

Use the Debian installer disc (or probably the live CD) in rescue mode. Select the option to execute a shell in the target system. Then run:

dpkg --configure -a

Exit out, and reboot. dpkg --unpack asks dpkg to install things w/o configuring them; dpkg --configure -a tells it to configure everything that isn't. Note you may get some errors from broken dependencies...

If that doesn't work, get back to the shell in the target system and try:

update-initramfs -u
update-grub

Then exit out, and reboot.

If either of these gets you booted (probably just to text mode—try the single user option in Grub), then next apt-get install -f will hopefully fix the dependency mess. Then you can apt-get install task-gnome-desktop.

derobert
  • 109,670