Installing NVIDIA Proprietary Drivers on Linux

After spending way too much time trying to get the proprietary NVIDIA drivers working on Debian 11, I finally got things working. It was a very simple solution but I couldn’t find anything explaining it online. This was done on Debian 11 with kernel 5.6.14-1 but, based on what I have found, is likely useful on several other distros.

In the past, I have normally used the Nouveau open source drivers. I have to say, the devs behind Nouveau have done an amazing job over the years. I’ve had computers that work perfectly right after an installation. With a very new GPU in my new computer, I did not expect it to work. But it worked perfectly right out of the box. Since I have never had a GPU this new before, I decided I want to put it to use and really heat up the house with it. So I opted to install the proprietary NVIDIA drivers this time.

At first when I would install the drivers, my machine would not boot because nvidia-persistence-daemon would keep failing. But I found the solution and it was very simple.

  1. Boot into BIOS and disable Secure Boot. (For instructions on that, do a search for something like “access bios on a [your computer brand/model]
  2. From the command line run sudo apt install linux-headers-amd64
  3. Then install the nvidia drivers. They may be differently named depending on your distro. On Debian you can run sudo apt install nvidia-driver.
  4. Then reboot and you should be set to go.

After installing the proprietary drivers, I noticed certain animations began working and things ran a little smoother. If for some reason you have trouble booting and you get a black screen or any other trouble. You can log in via the command line and uninstall the drivers. To do that just follow these steps:

  1. Press ctrl+F5
  2. You should see a login prompt. Login with root or your normal user.
  3. Run this command to uninstall all nvidia packages: sudo apt purge nvidia*
  4. Restart and you should be running Nouveau drivers again which means you’ll be able to log in as normal.

What do you think?