Complete Tutorial: How to Uninstall Nvidia Drivers and Restore Default Settings on Ubuntu

how to uninstall nvidia drivers ubuntu

Uninstalling Nvidia drivers on Ubuntu is a task that may become necessary for various reasons, such as resolving system conflicts, reverting to open-source drivers, or preparing for a fresh installation of updated drivers. This comprehensive guide provides detailed steps to safely remove Nvidia drivers and restore your system to its default settings, ensuring stability and optimal performance.

Why Uninstall Nvidia Drivers?

There are several scenarios where uninstalling Nvidia drivers becomes essential:

  • Driver Corruption: Over time, driver files can become corrupted due to system updates or software conflicts, leading to performance issues or hardware malfunctions.
  • System Conflicts: Proprietary Nvidia drivers may conflict with other system components or software, causing instability or crashes.
  • Switching to Open-Source Drivers: Users may prefer the open-source Nouveau drivers for their flexibility and community support.
  • Preparing for Driver Updates: A clean uninstallation of existing drivers ensures that new driver installations proceed without residual conflicts.

Understanding the need for uninstallation helps in maintaining a stable and efficient system environment.

Preliminary Steps

Before proceeding with the uninstallation, it’s crucial to prepare your system to prevent potential issues.

1. Verify Installed Nvidia Packages

Identifying the installed Nvidia packages allows for a thorough and complete removal.

  • Open Terminal: Press Ctrl + Alt + T to launch the terminal.
  • List Nvidia Packages: Execute the following command to display all installed Nvidia packages:

    bash Copy

    dpkg -l | grep -i nvidia

This command filters the installed packages, listing those related to Nvidia.

2. Backup Important Data

While uninstalling drivers is generally safe, it’s prudent to back up essential data to prevent any accidental loss.

  • Backup Configuration Files: If you’ve customized your Xorg configuration, back up the xorg.conf file:

    bash Copy

    sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup

This step ensures that you can restore your previous configuration if needed.

Uninstalling Nvidia Drivers

The uninstallation process varies depending on how the drivers were installed. We’ll cover methods for drivers installed via Ubuntu’s package manager and those installed using Nvidia’s official installer.

Method 1: Uninstalling Drivers Installed via Package Manager

If you installed the Nvidia drivers using Ubuntu’s package management system (apt), follow these steps:

  1. Purge Nvidia Packages: Remove all Nvidia-related packages:

    bash Copy

    sudo apt-get remove --purge '^nvidia-.*'

    The --purge option ensures that configuration files are also removed. The '^nvidia-.*' pattern targets all packages starting with “nvidia-“. askubuntu.com
  2. Remove Unused Dependencies: Clean up any dependencies that are no longer needed:

    bash Copy

    sudo apt-get autoremove

    This command removes orphaned packages that were installed as dependencies for the Nvidia drivers.
  3. Reinstall Ubuntu Desktop Package: In some cases, the ubuntu-desktop package might be removed during the purge. Reinstall it to ensure a functional desktop environment:

    bash Copy
    sudo apt-get install ubuntu-desktop

    This step reinstalls the core components of the Ubuntu desktop environment.

  4. Restore Default Xorg Configuration: If an xorg.conf file exists, remove it to allow the system to use default settings:

    bash Copy

    sudo rm /etc/X11/xorg.conf

    This action ensures that Xorg uses automatic configuration, which is suitable for most users.
  5. Reboot the System: Restart your computer to apply the changes:

    bash Copy

    sudo reboot

    Upon reboot, the system should default to the open-source Nouveau drivers.

Method 2: Uninstalling Drivers Installed via Nvidia’s Official Installer

If you installed the drivers using Nvidia’s .run file, the uninstallation process differs:

  1. Locate the Original Installer: Find the exact .run file used for installation. If it’s no longer available, re-download the same version from Nvidia’s website.
  2. Run the Uninstaller: Navigate to the directory containing the .run file and execute:

    bash Copy

    sudo bash NVIDIA-Linux-x86_64-<version>.run --uninstall

    Replace <version> with the specific version number of the installer. This command launches the uninstaller provided by Nvidia. linuxconfig.org
  3. Follow On-Screen Prompts: The uninstaller will guide you through the removal process. Follow the prompts to complete the uninstallation.
  4. Restore Default Xorg Configuration: As with the package manager method, remove any existing xorg.conf file:

    bash Copy

    sudo rm /etc/X11/xorg.conf
  5. Reboot the System: Restart your computer to apply the changes:

    bash Copy

    sudo reboot

    After rebooting, the system should revert to using the Nouveau drivers.


    How to Successfully Install Nvidia GPU Drivers on Fedora 39

Post-Uninstallation Steps

After removing the Nvidia drivers, consider the following steps to ensure your system operates correctly.

1. Verify the Active Graphics Driver

Confirm that the Nouveau driver is active:

  • Check Loaded Modules: Run the following command:

    bash Copy

    tlsmod | grep nouveau

Leave a Reply

Your email address will not be published. Required fields are marked *