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?