6

After uninstalling some python packages (got rid of of 3.9 and 3.8), I rebooted my computer and now it gets stuck at the boot screen with the motherboard logo, right before the ubuntu loading screen.

I have recently updated my graphics drivers and have installed cuda, so I thought that might have something to do with it. I did ctrl + alt+F2 and ran sudo apt-get purge nvidia* following the advice from this thread https://askubuntu.com/a/974910/1196087 It did not help.

I have also tried installing various packages, I've used the recovery mode dpkg to repair any broken packages, but anything I try to install or upgrade, including sudo apt update and --fix-missing commands get errors such as "Temporary failure resolving x", "Failed to fetch x": Failed to fetch

The boot parameters look like this if that is of any help: boot parameters

Please let me know if you need any more info.

Appreciate any help!

3 Answers3

10

First of all, you need to boot into recovery mode and select:

root            Drop to root shell prompt

Then check if you have an active internet connection by pinging Google's DNS server. If you have, skip the first step and go to the second step.

  1. Execute these commands

    ip link
    ip link set <interface> up
    dhclient <interface>
    ip addr show dev <interface>
    

    If you got an IP address from your router check the internet connection again by pinging Google's DNS server.

  2. Install ubuntu-desktop and reboot:

    sudo apt-get install ubuntu-desktop
    reboot
    

After these steps you should be able to boot into Ubuntu.

0

Press alt+F2 when a cursor blinks. This should get you to tty (terminal).

If you got tty on the screen just run:

sudo apt-get install ubuntu-desktop
reboot

If no gui is on press esc or shift before splash and run:

sudo apt-get install ubuntu-desktop
reboot

the problem here is that you lost the gnome, so you need to install it again. No worries about losing data or files.

0

Faced the same issue (By mistake uninstalled Python) and for me the safe mode even was not working. The ubuntu desktop was gone and it was landing to terminal after restart all the time. While running commands it was throwing messages like-

unmet dependencies Try apt --fix-broken install

After investing 12 hours and to save my critical data the steps to bring back the VM could be summarized in below steps:

  1. switch to root user sudo su -

  2. Internet connectivity was gone. I tried pinging google from my ubuntu box and it threw error -

network is unreachable

So to solve this issue first I had to run below commands

sudo rmmod e1000
sudo rmmod e1000e
sudo rmmod igb
sudo modprobe e1000
sudo modprobe e1000e
sudo modprobe igb
sudo dhclient ens33
  1. Now internet was back, I was able to ping google dns. If your internet is

    working you can skip step 2; Next commands-

sudo apt-get update && sudo apt-get upgrade
sudo apt --fix-broken install
sudo apt-get purge network-manager
sudo apt-get install network-manager --fix-broken
sudo apt-get install ufw --fix-broken
sudo apt-get install python3:any --fix-broken
sudo apt-get install ubuntu-desktop

Hurrah ! The terminal switched back to linux desktop view and everything was the same as before.