.
- Boot in recovery mode with read/write access
- Go to shell as root
- sudo apt-get remove lightdm (now gdm3 is default)
- Start the network: sudo service network-manager restart
- sudo apt upgrade
- reboot
How to Boot to Recovery Mode (Safe Mode) in Ubuntu
As you’re booting your computer, wait for the manufacturer logo to flash from the BIOS. If your computer boots too quickly, you’re going to need to do this immediately after powering it on. Quickly press either the Shift or Escape key. On newer computers it’s probably Escape. The timing has to be near perfect on some computers, so you may have to press it repeatedly.
https://www.maketecheasier.com/boot-recovery-mode-ubuntu/
https://askubuntu.com/questions/990279/ubuntu-hangs-on-boot-after-blackout-detect-the-available-gpus