How Do You Uninstall Nvidia Drivers on Ubuntu?

If you’re an Ubuntu user who has installed Nvidia drivers to harness the full power of your graphics card, you might eventually find yourself needing to uninstall them—whether to troubleshoot issues, switch to a different driver version, or revert to the default open-source drivers. Removing Nvidia drivers on Ubuntu can seem daunting at first, especially for those new to Linux, but with the right guidance, it’s a straightforward process that ensures your system stays stable and performs optimally.

Understanding how to properly uninstall Nvidia drivers is crucial because improper removal can lead to display problems or system instability. This article will walk you through the essentials of the uninstallation process, highlighting the key considerations and common scenarios where removing these drivers becomes necessary. Whether you’re aiming to clean up your system or prepare for a fresh driver installation, gaining clarity on this topic will empower you to manage your Ubuntu environment confidently.

Before diving into the step-by-step instructions, it’s helpful to grasp why and when you might want to uninstall Nvidia drivers, as well as the different methods available depending on how the drivers were initially installed. By exploring these foundational aspects, you’ll be well-prepared to follow the detailed guidance that follows and ensure a smooth transition for your graphics setup.

Uninstalling Nvidia Drivers Using the Terminal

To remove Nvidia drivers from your Ubuntu system, the terminal offers precise control and clear feedback during the process. Begin by identifying the installed Nvidia packages, then proceed with their removal. This method ensures a clean uninstallation without residual files that might interfere with other drivers.

First, open your terminal and list all Nvidia-related packages installed on your system by running:

“`bash
dpkg -l | grep -i nvidia
“`

This command displays a list of Nvidia packages currently present. To uninstall the drivers, use the following command:

“`bash
sudo apt-get purge ‘^nvidia-.*’
“`

The caret (^) and the regex pattern `’nvidia-.*’` ensure all packages starting with `nvidia-` are targeted. Using `purge` instead of `remove` deletes the configuration files along with the packages, which helps prevent conflicts if you plan to reinstall or switch to different drivers.

After the purge completes, it is recommended to clean up any leftover dependencies:

“`bash
sudo apt-get autoremove
sudo apt-get autoclean
“`

These commands remove unused packages and clear the local repository of retrieved package files, freeing up disk space.

Finally, to revert to the default open-source Nouveau driver or to prepare for a different driver installation, reboot your system:

“`bash
sudo reboot
“`

Using the Nvidia Installer Script to Remove Drivers

If you installed Nvidia drivers using the official Nvidia installer script rather than through Ubuntu’s package manager, the removal process differs slightly. The Nvidia installer creates its own files and does not register the installation with `apt`.

To uninstall drivers installed via the Nvidia `.run` file:

  • Locate the installer script you originally used. If you no longer have it, download the same version from the official Nvidia website.
  • Open a terminal and switch to a console session by pressing `Ctrl + Alt + F1` (or `F2` to `F6`), then log in.
  • Stop the display manager to prevent conflicts during uninstallation. Depending on your desktop environment, use one of the following commands:

“`bash
sudo systemctl stop gdm For GNOME
sudo systemctl stop lightdm For LightDM
sudo systemctl stop sddm For SDDM
“`

  • Navigate to the directory containing the Nvidia installer and run:

“`bash
sudo ./NVIDIA-Linux-x86_64-*.run –uninstall
“`

Replace `NVIDIA-Linux-x86_64-*.run` with the exact filename of the installer script. The `–uninstall` flag initiates the removal process.

  • Follow the on-screen prompts to complete the uninstallation.
  • Restart your system once finished to apply changes:

“`bash
sudo reboot
“`

Managing Nvidia Driver Versions and Dependencies

When uninstalling Nvidia drivers, it is crucial to understand the dependencies and the potential impact on your system’s graphics stack. Nvidia drivers often involve kernel modules, OpenGL libraries, and X server configuration files. Improper removal might lead to a broken graphical interface.

The table below summarizes common Nvidia driver components and their roles:

Component Description Impact if Not Removed
nvidia-driver-XXX Main proprietary driver package System may load outdated or conflicting drivers
nvidia-kernel-common Kernel modules supporting the driver Kernel modules may remain loaded, causing conflicts
libnvidia-gl-XXX OpenGL libraries for Nvidia OpenGL applications may fail or use wrong libraries
nvidia-settings Configuration utility for Nvidia drivers Settings app may remain, causing confusion

To avoid problems, always ensure you purge all Nvidia-related packages and clean residual configuration files. Additionally, check for any custom files like `/etc/X11/xorg.conf` that might have been created for Nvidia-specific settings. You can back up and remove or rename this file as it may force the system to use Nvidia drivers even after removal.

Reverting to the Default Nouveau Driver

Ubuntu typically uses the open-source Nouveau driver for Nvidia hardware by default. After uninstalling proprietary Nvidia drivers, you may want to revert to Nouveau to restore basic graphics functionality.

To enable Nouveau after Nvidia removal:

  • Check that the Nouveau kernel module is not blacklisted. Nvidia drivers often blacklist Nouveau to prevent conflicts. Inspect blacklist files with:

“`bash
grep -r nouveau /etc/modprobe.d/
“`

  • If you find entries like `blacklist nouveau`, comment them out or delete the lines.
  • Regenerate the initial RAM filesystem to apply changes:

“`bash
sudo update-initramfs -u
“`

  • Reboot your system:

“`bash
sudo reboot
“`

Once rebooted, verify Nouveau is active by running:

“`bash
lsmod | grep nouveau
“`

If Nouveau appears in the output, it is loaded and managing your Nvidia hardware.

Additional Tips and Precautions

When uninstalling Nvidia drivers, consider the following best practices:

  • Always back up important data before making changes to system drivers.
  • If you plan to switch between different Nvidia driver versions, fully purge previous versions before installation.
  • Use `ubuntu-drivers devices` to see recommended drivers and ensure compatibility.
  • Avoid mixing installation methods (e.g., do not install some components via `apt` and others via the Nvidia `.run` script).
  • Monitor system logs (`/var/log/syslog` or `dmesg`) for errors related to graphics drivers

Uninstalling Nvidia Drivers on Ubuntu

To remove Nvidia drivers cleanly from your Ubuntu system, it is important to follow a structured process. This ensures that all related packages and configurations are properly cleared, avoiding conflicts with other graphics drivers or system components.

Begin by identifying the currently installed Nvidia drivers and related packages. This can be done using the package management tools native to Ubuntu.

  • Open a terminal window.
  • Check for installed Nvidia packages using:
dpkg -l | grep -i nvidia

This command lists all packages related to Nvidia, including drivers, utilities, and kernel modules.

Stopping the Display Manager

Before uninstalling, it is recommended to stop the graphical display manager to prevent conflicts during the removal process:

  • Identify your display manager (e.g., gdm, lightdm, sddm) by:
cat /etc/X11/default-display-manager
  • Stop the display manager, replacing gdm3 with your own if different:
sudo systemctl stop gdm3

Removing Nvidia Drivers Using Package Manager

Once the graphical session is stopped, proceed to remove the Nvidia driver packages.

  • To remove all Nvidia packages installed via APT, run:
sudo apt-get purge '^nvidia-.*'
  • Remove any residual configuration files:
sudo apt-get autoremove
  • Additionally, remove any manually installed Nvidia drivers from the official Nvidia installer by running the uninstall script:
sudo /usr/bin/nvidia-uninstall

This script is only present if drivers were installed manually from Nvidia’s website.

Reverting to the Open-Source Nouveau Driver

After uninstalling Nvidia drivers, ensure the open-source Nouveau driver is enabled:

  • Remove any blacklist entries that disable Nouveau:
sudo rm /etc/modprobe.d/blacklist-nouveau.conf
  • Regenerate the kernel initramfs to apply changes:
sudo update-initramfs -u

Restarting the System

Once the Nvidia drivers have been purged and Nouveau enabled, reboot the system to finalize changes:

sudo reboot

Summary of Commands for Nvidia Driver Uninstallation

Step Command Description
List Nvidia packages dpkg -l | grep -i nvidia Identify installed Nvidia-related packages
Stop display manager sudo systemctl stop gdm3 Stop graphical session to avoid conflicts
Remove Nvidia packages sudo apt-get purge '^nvidia-.*' Uninstall Nvidia drivers and utilities
Clean residual files sudo apt-get autoremove Remove unused dependencies and config files
Run Nvidia uninstall script sudo /usr/bin/nvidia-uninstall Remove manual driver installations (if applicable)
Enable Nouveau driver sudo rm /etc/modprobe.d/blacklist-nouveau.conf
sudo update-initramfs -u
Re-enable open-source Nvidia driver and refresh kernel settings
Reboot system sudo reboot Apply all changes and start fresh

Expert Insights on How To Uninstall Nvidia Drivers on Ubuntu

Dr. Elena Martinez (Linux Systems Engineer, Open Source Solutions Inc.) advises, “To safely uninstall Nvidia drivers on Ubuntu, it is critical to first stop the graphical server to prevent conflicts. Using the command `sudo systemctl stop gdm` or the equivalent for your display manager, followed by `sudo apt-get purge nvidia-*`, ensures complete removal of all Nvidia packages. Afterward, reconfiguring the default Nouveau driver with `sudo dpkg-reconfigure xserver-xorg` helps restore system stability.”

Jason Lee (GPU Software Developer, TechCore Labs) emphasizes, “When uninstalling Nvidia drivers on Ubuntu, it is best practice to check for any residual configuration files that might interfere with future installations. Executing `sudo apt-get autoremove` and verifying the blacklist entries in `/etc/modprobe.d/` prevents leftover settings from causing driver conflicts. Additionally, rebooting the system after uninstallation is essential to ensure the kernel modules are properly unloaded.”

Sophia Chen (Senior Linux Administrator, CloudNet Services) states, “Using the Nvidia-provided uninstallation script `sudo nvidia-uninstall` is often the cleanest method when available, as it removes all driver components installed via the official Nvidia installer. For Ubuntu users who installed drivers through the package manager, purging via `apt` or `dpkg` is recommended. Always verify the current driver status with `nvidia-smi` before and after removal to confirm success.”

Frequently Asked Questions (FAQs)

How do I completely remove Nvidia drivers from Ubuntu?
To completely remove Nvidia drivers, run `sudo apt-get purge nvidia-*` followed by `sudo apt autoremove`. This will uninstall all Nvidia packages and dependencies.

Can I uninstall Nvidia drivers using the Ubuntu GUI?
Yes, you can use the “Software & Updates” application under the “Additional Drivers” tab to switch to the open-source Nouveau driver or uninstall proprietary Nvidia drivers.

What command removes Nvidia drivers installed via the Nvidia .run file?
Navigate to the directory containing the installer and run `sudo ./NVIDIA-Linux-x86_64-*.run –uninstall` to remove drivers installed with the official Nvidia script.

Is it necessary to blacklist the Nouveau driver after uninstalling Nvidia drivers?
No, blacklisting Nouveau is not necessary after uninstalling Nvidia drivers unless you plan to reinstall Nvidia drivers and want to prevent conflicts.

How can I verify that Nvidia drivers have been successfully uninstalled?
Run `nvidia-smi` or `nvidia-settings`. If these commands return errors or are not found, the Nvidia drivers are likely removed.

Will uninstalling Nvidia drivers affect my system’s display settings?
Uninstalling Nvidia drivers will revert your system to use the default open-source drivers, which may alter display performance and resolution until reconfigured.
Uninstalling Nvidia drivers on Ubuntu is a straightforward process that involves using terminal commands to remove the installed packages. Whether the drivers were installed via the official Ubuntu repositories, the Nvidia PPA, or directly from the Nvidia website, it is essential to follow the appropriate removal steps to ensure the system reverts to the default open-source drivers or prepares for a fresh driver installation. Common methods include using `apt-get remove` or `apt purge` commands for package-based installations and running the Nvidia installer script with the `–uninstall` option for manual installations.

It is important to properly uninstall Nvidia drivers to prevent conflicts, system instability, or issues with graphical performance. After removal, updating the system’s package lists and reconfiguring the X server or rebooting the system helps apply the changes effectively. Additionally, users should verify the driver removal by checking the active GPU drivers and ensuring that the nouveau driver or other default drivers are in use if desired.

In summary, understanding the installation method initially used is crucial for selecting the correct uninstallation approach. Careful execution of the removal commands and system updates will maintain system integrity and provide a clean environment for any future driver installations or troubleshooting efforts. This process ensures that Ubuntu systems run optimally with

Author Profile

Avatar
Barbara Hernandez
Barbara Hernandez is the brain behind A Girl Among Geeks a coding blog born from stubborn bugs, midnight learning, and a refusal to quit. With zero formal training and a browser full of error messages, she taught herself everything from loops to Linux. Her mission? Make tech less intimidating, one real answer at a time.

Barbara writes for the self-taught, the stuck, and the silently frustrated offering code clarity without the condescension. What started as her personal survival guide is now a go-to space for learners who just want to understand what the docs forgot to mention.