Score:2

Ubuntu no longer boots after reinstalling graphics driver

us flag

Ubuntu-Version: 22.04 or 22.10, can't check anymore

I started my machine today and discovered that the desktop environment wasn't loaded. I got some text which seemed to indicate ubuntu services starting, then it disappeared and I had a black screen with a blinking cursor. I was able to switch to a terminal with ctrl+alt+f3. After some googling and some digging around I ran sudo lshw -c video and saw the word unclaimed next to my graphics card, which I understood as the graphics driver not working. So I did a sudo ubuntu-drivers devices and picked the recommended driver, which was as I recall nvidia-driver-520-open. So I tried to install it with sudo ubuntu-drivers install nvidia-driver-520-open. It reported that all drivers were already installed. So I figured I could reinstall with apt: sudo apt-get install --reinstall nvidia-driver-520-open (I think, I'm writing this from memory). Then I rebooted, and got the same again. After some more googling, I find a post suggesting I need to install the linux-headers for the kernel version So I did sudo apt-get install linux-headers-5.17.0-1020-oem(again - version from memory) and rebooted again. And this time I got the gnome login screen and was able to log in. However I found in the ubuntu settings that the selected grahics card? was llvmpipe. So I tried selecting the nvidia graphics card using sudo prime-select nvidia and rebooted again. This changed nothing. So I thought I might have to try a different version of the driver. I went to "Software & Updates" > "Additional drivers" and selected the 515 version of the driver. After the installation was finished I rebooted. However now I can no longer really boot. I get some text which I assume to be kernel logs, then I get a black screen with the cursor again, but this time I cannot switch to a terminal. After retrying several times, I got gnome again, but the screen turned black a few seconds after logging in and it went unresponsive.

I am able to boot from the usb drive I used to install ubuntu

I realise that I've probably been an idiot here, but is there any way I can fix this?

raddevus avatar
us flag
I suffered this problem yesterday and posted : https://askubuntu.com/questions/1437047/kernel-update-wont-allow-nvidia-1660-drivers-on-ubuntu-22-04-how-do-i-fix It's really quite terrible and I had to do a complete install to fix it also.
HBnet avatar
us flag
@raddevus yeah, that looks like the same problem, unfortunately I don't have a backup ready to go. I'll try Hannu's answer, but I'm afraid it's going to be a reinstall for me too.
Score:2
ca flag
  1. Boot, as the "BIOS" text appears, hit ESC once
    (If that does not work, try holding down either SHIFT key)
  2. ... that should make the "grub menu" appear.
  3. Under the "Advanced" option, find "Recovery mode" for your latest kernel version and select it.
  4. Yet another menu should appear; select options fsck, enable networking and then drop to root prompt, hit Enter to actually get to the # prompt - i.e. Bash as user root.
  5. Here you may do many things freely, i.e. destroy your Linux - so be thorough with what you type.
  6. dpkg --list | grep ^ii.*nvidia will tell which nvidia related packages are installed.
  7. do sudo apt purge package-name on all of it,
  8. then do reboot and see if you can log in normally...
  9. If yes; hit Super-key (Win-Key) and start typing Additional drivers, quite soon a greenish icon will appear; click on it / select it and hit Enter. Install an older nVidia driver and see if that works (I'm using 470)
  10. if no; get back to the recovery mode root prompt and attempt to install e.g. version 470 of nvidia-drivers from there... type apt install nvidia and hit TAB at that point; a list of available drivers should appear; type the first char of one and hit TAB again... then with the full name, hit Enter to attempt install.
    (keep an eye on if there are any errors while installing! Try to revert such an installation with "purge" above)
HBnet avatar
us flag
thank you for the help! I'll backup my home directory using the usb boot first though before I try anything else...
Hannu avatar
ca flag
Consider this a first step (sequence) to attempt, there might be bigger problems behind though. Keep eyes open for errors.
HBnet avatar
us flag
I have been unable to enter the grub menu, neither the esc key, nor holding down the shift key did anything, probably going to reinstall ubuntu.
Fitzi avatar
vn flag
I had the same issues as OP after updating to 525 today. I had to purge all nvidia packages as you described and then install both nvidia-driver-525 and nvidia-dkms-525 for it to work again.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.