How can I uninstall a nvidia driver completely ?

788,725

Solution 1

For Ubuntu 12.04

Commands can be executed to terminal. You can open a terminal with Ctrl + Alt+T keys combo.

If you remove --purge the nvidia driver you will be OK. No need to blacklist something, but sometimes maybe a force-load of the nouveau module needed.

First uninstall completely the driver.

Search what packages from nvidia you have installed.

dpkg -l | grep -i nvidia

except the package nvidia-common all other packages should be purged.


If you want to be sure that you will purge everything related to nvidia you can give this command

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

the .* in the end means (Purge everything that begins (^) with the name nvidia-)

BUT

above command will also remove the nvidia-common package and the nvidia-common package has as a dependency the ubuntu-desktop package.

So after above command you should also give the installation command for ubuntu-desktop package

sudo apt-get install ubuntu-desktop

Also sometimes the nouveau driver get blacklisted from nvidia driver. With purge command it should UN-blacklisted. If you want to be sure that nouveau will be load in boot, you can force-load it by add it to /etc/modules

echo 'nouveau' | sudo tee -a /etc/modules

Last , search for the xorg.conf file and remove it as well

sudo rm /etc/X11/xorg.conf

In summary

sudo apt-get remove --purge '^nvidia-.*'
sudo apt-get install ubuntu-desktop
sudo rm /etc/X11/xorg.conf
echo 'nouveau' | sudo tee -a /etc/modules

Although all above commands not needed, this is my way to completely purge the nvidia driver and use the open source nounveau.

Solution 2

I just used the nvidia-uninstall.

sudo nvidia-uninstall

In my case I got the driver directly from the nvidia website.

Solution 3

If you have only access to GRUB:

  1. Restart your computer
  2. Select Advanced options for Ubuntu at GRUB Boot Menu
  3. Select Ubuntu ..... (recovery mode)
  4. Select dpkg Repair broken packages at the Recovery Menu (this will stop the nvidia processes so we can uninstall). Choose Yes. When finished press ENTER (even if it found problems)
  5. Select root (Drop to root shell promt at the Recovery Menu)
  6. Type your root password
  7. Type: apt-get remove --purge nvidia-*
  8. If finished type: reboot
  9. Boot as usual, it should go to your Ubuntu Login screen now

Solution 4

I didn't want to modify /etc/modules, and just revert to an install without the nvidia drivers. So I mostly did as the accepted suggested, but instead of the last step, I do this:

sudo rm /etc/modprobe.d/blacklist-nouveau.conf
sudo update-initramfs -k all -u

So my variant summary:

sudo apt-get remove --purge nvidia-*
sudo apt-get install ubuntu-desktop
sudo rm /etc/X11/xorg.conf
sudo rm /etc/modprobe.d/blacklist-nouveau.conf
sudo update-initramfs -k all -u

Solution 5

To uninstall nVIDIA driver, open terminal by pressing (Ctrl+Alt+T) then type:

sudo apt-get purge nvidia-current
Share:
788,725

Related videos on Youtube

VedVals
Author by

VedVals

I am a student of Instrumentation and Control AT VIT, Pune, India. I am a Linux enthusiast with a desire to learn whatever I find interesting. I Love to learn new things anytime. I Also like to try to trash my Ubuntu system in as many ways as possible.

Updated on September 18, 2022

Comments

  • VedVals
    VedVals almost 2 years

    As expected, Nvidia drivers have reduced my customizations. I can't login to Unity 3D session. I can't find any content to help me to uninstall the driver and I don't know what to do as I have never uninstalled them before.

    • Admin
      Admin over 10 years
      About the unity, do "unity --reset"
  • Jorge M. Treviño
    Jorge M. Treviño over 11 years
    Your recipe just solved for me a similar problem that kept me last night fiddling with my computer until 3 am. Not enough thanks.
  • alvas
    alvas about 11 years
    Yes indeed it worked as a charm!!
  • travisw
    travisw over 10 years
    This answer is still helping out! Fixed my Lubuntu 13.10. Thanks!
  • octopusgrabbus
    octopusgrabbus over 10 years
    I was referred here from askubuntu.com/questions/416881/… This is an excellent answer. Thanks.
  • techriften
    techriften about 10 years
    Works also on Ubuntu 14.04 (after upgrading from 13.10)! NICE
  • ovrwngtvity
    ovrwngtvity about 10 years
    Works on Ubuntu 12.04
  • tumultous_rooster
    tumultous_rooster over 9 years
    what if you only have access to GRUB?
  • fatal_error
    fatal_error over 9 years
    @MattO'Brien one thing you could try is append init=/bin/bash to your Linux boot line from within GRUB. that would boot you up to the command line where you can do the rest. Alternatively, try appending novideo or novga to image line/root fs line instead.
  • penta
    penta over 8 years
    this answer removes the nvidia packages but it also crashes the unity plugin, follow this to re-enable unity askubuntu.com/questions/17381/…
  • allidoiswin
    allidoiswin over 7 years
    I'm on Ubuntu 15.10 (XPS 15 9550 w/ 960m) and I tried this after getting a fatal error: no screens found. Didn't work, continued to be same error (stuck on Starting Light Display Manager).
  • Tahbaza
    Tahbaza about 7 years
    this corrected driver issues on boot with 16.04
  • Ganesh Kathiresan
    Ganesh Kathiresan about 7 years
    Works like a charm. This is seriously the only fix for infinite login screen issue on Debian and Ubuntu. I think that's what @Jorge M. Treviño is referring to.
  • SEarle1986
    SEarle1986 over 6 years
    Working on 17.04
  • WinEunuuchs2Unix
    WinEunuuchs2Unix about 6 years
    On my Ubuntu 16.04 LTS there is no nvidia-common package so the extra step of sudo apt-get install ubuntu-desktop can be omitted. Also there is no /etc/X11/xorg.conf file. Running locate xorg.conf reveals many files.
  • Fabian Röling
    Fabian Röling over 5 years
    Thank you so much for saving my system! If this hadn't worked, I would have probably had to reinstall my entire system.
  • danShumway
    danShumway about 5 years
    Worked for me in Ubuntu 16.04 LTS, minus the need to reinstall ubuntu-desktop. This answer was a huge lifesaver for me.
  • Infinite Loops
    Infinite Loops about 5 years
    nvidia-uninstall no longer supported. No command found in Disco Dingo
  • Victor Sergienko
    Victor Sergienko about 5 years
    @InfiniteLoops, that must be caused by you installing the drivers from repository. The driver that's installed from NVidia website does have the nvidia-uninstall command in 2019.
  • Admin
    Admin over 3 years
    You can do it even more simply: dpkg -l | grep nvidia-driver. Then purge the driver and perform the autoremove and autoclean. This will get you to the same point but avoid you from having to look through more dpkg results
  • Charlie Parker
    Charlie Parker almost 3 years
    waht does the ^ do in your command?
  • Charlie Parker
    Charlie Parker almost 3 years
    I don't get it why am I doing sudo apt-get install ubuntu-desktop?
  • Charlie Parker
    Charlie Parker almost 3 years
    why are you talking about nouveau ? That is not related to removing nvidia-drivers... :/
  • Charlie Parker
    Charlie Parker almost 3 years
    why not just do sudo apt-get --purge remove nvidia*?
  • Admin
    Admin about 2 years
    user383919 and your answer did the trick. thanks a lot
  • Admin
    Admin about 2 years
    omg! its perfect! you save my night!