Ubuntu 19.04 stuck on boot

Following worked for me. Very simple but effective till now:

  1. Open terminal with Ctrl+Alt+T

  2. Type sudo gedit /etc/gdm3/custom.conf

  3. Type the password when prompted. (It will not be visible while typing.) edit the file and remove '#' located at the beginning of the following line (its 7th line)

    #Wayland = false
    
  4. So now the line will look like this - Wayland = false

  5. Save and close the window

  6. Exit and restart


If anyone else faces this problem, but you cannot access to the terminal because the Nvidia driver, @sangharshs seems to be the clue.

We need to deactivate Wayland, in order to let the Nvidia driver work properly. As it only works with Xorg.

There are some chances that when you install Nvidia, you'll get stuck in a black or purple screen, when booting Ubuntu. If that's the case, then you need to do the following:

  1. Reboot your computer
  2. Select the Advanced options for Ubuntu option, below the "Ubuntu" one, in the Grub panel
  3. Select any of the recovery mode options that you get listed. Doesn't matter what kernel you choose, if you have more than one.
  4. Wait until a new panel appears. And choose the root option.
  5. Edit the /etc/gdm3/custom.conf file with nano, vi or vim. For example: vim /etc/gdm3/custom.conf
  6. Change the line #Wayland = false into Wayland = false (or WaylandEnable instead of Wayland)
  7. Run reboot

That's it! You have Ubuntu running along with the Nvidia driver again.