Score:-1

Can't install NVIDIA drivers after I accidentally removed them

pw flag

So, I accidentally uninstalled NVIDIA drivers with apt autoremove, I tried to reinstall it from "Software & Updates" app but all the options in Additional drivers are greyed out.

I don't want to manually install NVIDIA drivers using the packages from NVIDIA's website because it's very tedious and usually does not work, What should I do now?

My laptop is Lenovo IdeaPad L340 Gaming with Gtx1650, if that's required. I'm running Ubuntu Desktop 21.04 latest stable release

ChanganAuto avatar
us flag
*I accidentally uninstalled NVIDIA drivers with apt autoremove* No, you didn't, `autoremove` doesn't do such a thing. You did **something else** and that would be a nice addition to your question as it would probably explain the grayed out options in Additional Drivers.
Zeiss Ikon avatar
cn flag
Welcome to AskUbuntu. Please be sure to take the [tour] and read the [FAQ] to get a better idea how this site works. And if you have more information to add (such as what you did before `apt autoremove` ) please [edit] it into the question.
Armia Khairy avatar
pw flag
@ChanganAuto Yes I did, I noticed that some nvidia package was one of the packages that would be removed, and ```autoremove``` said there will be 400MBs free (on a somewhat fresh minimal install) ,I thought that this was an older driver package or something, after using the PC and restarting later, my 2nd monitor isn't recognized. searched for installed packages for nvidia and found nothing. and tried using "Software & Updates" and all the options are greyed out.
Score:0
ng flag

Try running these commands

sudo add-apt repository ppa:graphics-drivers/ppa

Then

sudo apt-get update

and finally,

sudo apt-get install nvidia-driver-430

Here, 430 is the version of nvidia driver, you can choose yours according to your nvidia driver.

Armia Khairy avatar
pw flag
Will this work with any Debian-based distro ?
us flag
@ArmiaKhairy Not necessarily. Debian itself does not support Launchpad PPA.
Score:0
pw flag

After more digging, I found that sudo ubuntu-drivers autoinstall installed NVIDIA drivers for me and now my device went back to normal, I rechecked if apt autoremove will again remove the drivers, but it didn't this time. I guess it was some bug during the installation during OS installation made the driver packages marked as unused.

Zeiss Ikon avatar
cn flag
Ubuntu installs Nouveau (FOSS) video drivers for nVidia hardware by default, rather than the proprietary that "taints" the kernel.
Armia Khairy avatar
pw flag
I checked additional drivers now, and It tells me that it's "Using NVIDIA driver metapackage from nvidia-driver-470 (Proprietary, tested)", so I guess it's not the Nouveau one.
Zeiss Ikon avatar
cn flag
Glad to hear it. I'd use the FOSS driver, but it won't run CUDA apps.
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.