Debian

How to Clean Install NVIDIA Drivers on Debian 11

While installing the official NVIDIA drivers on Debian 11, things may go wrong in many ways. This may result in the official NVIDIA drivers not working on your computer/laptop. Or, in the worst-case scenario break the operating system and show you a black screen.

To solve this problem, you can try to uninstall the official NVIDIA drivers completely from your Debian 11 operating system and try to install the official NVIDIA drivers again.

In this article, I am going to show you how to uninstall the official NVIDIA drivers from Debian 11 completely so that you can clean install the official NVIDIA drivers on Debian 11.

Table of Contents:

  1. Completely Uninstalling Official NVIDIA Drivers from Debian 11
  2. Re-installing/Clean Installing Official NVIDIA Drivers on Debian 11
  3. Conclusion

Completely Uninstalling Official NVIDIA Drivers from Debian 11

First, open a Terminal app on Debian 11 from the Application menu.

Then, update the APT package repository cache with the following command:

$ sudo apt update

Graphical user interface, text, application, email Description automatically generated

To remove the official NVIDIA drivers from Debian 11 completely, run the following command:

$ sudo apt remove nvidia-* --purge

Graphical user interface, text Description automatically generated

To confirm the uninstallation, press Y and then press <Enter>.

The official NVIDIA drivers are being uninstalled. It will take a while to complete.

Graphical user interface, text, application, email Description automatically generated

At this point, the official NVIDIA drivers should be uninstalled.

A screenshot of a computer Description automatically generated

To remove the dependency packages of the official NVIDIA drivers as well, run the following command:

$ sudo apt autoremove --purge

Graphical user interface, text, application Description automatically generated

To confirm the action, press Y and then press <Enter>.

Text Description automatically generated

The dependency packages of the official NVIDIA drivers are being removed. It will take a while to complete.

Text Description automatically generated

At this point, all the dependency packages of the official NVIDIA drivers should be removed.

Text Description automatically generated

Run the following command to delete all the cached NVIDIA drivers packages along with the dependency packages to save disk space:

$ sudo apt clean

Graphical user interface Description automatically generated with low confidence

For the changes to take effect, run the following command to restart your computer/laptop:

$ sudo reboot

A picture containing graphical user interface Description automatically generated

Once your computer/laptop starts, you should see that the nouveau kernel modules are used instead of the official nvidia kernel modules. So, the official NVIDIA drivers are uninstalled completely and Debian 11 successfully switched to the open-source Nouveau drivers.

$ lsmod | grep nouveau

$ lsmod | grep nvidia

A picture containing graphical user interface Description automatically generated

Re-installing/Clean Installing Official NVIDIA Drivers on Debian 11

At this point, the official NVIDIA drivers should be uninstalled from Debian 11 completely. Now, you can try to install the official NVIDIA drivers on Debian 11 again and see if your problem is resolved. If you need any assistance in installing the official NVIDIA drivers on Debian 11, check the article Install NVIDIA Drivers on Debian 11.

Conclusion

I have shown you how to uninstall the official NVIDIA drivers from Debian 11 completely so that you can clean install the official NVIDIA drivers again on Debian 11 in case you have any problems getting the official NVIDIA drivers to work on Debian 11.

About the author

Shahriar Shovon

Freelancer & Linux System Administrator. Also loves Web API development with Node.js and JavaScript. I was born in Bangladesh. I am currently studying Electronics and Communication Engineering at Khulna University of Engineering & Technology (KUET), one of the demanding public engineering universities of Bangladesh.