How can I uninstall a nvidia driver completely ?
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:
- Restart your computer
- Select
Advanced options for Ubuntu
at GRUB Boot Menu - Select
Ubuntu ..... (recovery mode)
- 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) - Select
root
(Drop to root shell promt at the Recovery Menu) - Type your root password
- Type:
apt-get remove --purge nvidia-*
- If finished type:
reboot
- 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
Related videos on Youtube
![VedVals](https://i.stack.imgur.com/mkmId.jpg?s=256&g=1)
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, 2022Comments
-
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 over 10 yearsAbout the unity, do "unity --reset"
-
-
Jorge M. Treviño over 11 yearsYour recipe just solved for me a similar problem that kept me last night fiddling with my computer until 3 am. Not enough thanks.
-
alvas about 11 yearsYes indeed it worked as a charm!!
-
travisw over 10 yearsThis answer is still helping out! Fixed my Lubuntu 13.10. Thanks!
-
octopusgrabbus over 10 yearsI was referred here from askubuntu.com/questions/416881/… This is an excellent answer. Thanks.
-
techriften about 10 yearsWorks also on Ubuntu 14.04 (after upgrading from 13.10)! NICE
-
ovrwngtvity about 10 yearsWorks on Ubuntu 12.04
-
tumultous_rooster over 9 yearswhat if you only have access to GRUB?
-
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 over 8 yearsthis answer removes the nvidia packages but it also crashes the unity plugin, follow this to re-enable unity askubuntu.com/questions/17381/…
-
allidoiswin over 7 yearsI'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 about 7 yearsthis corrected driver issues on boot with 16.04
-
Ganesh Kathiresan about 7 yearsWorks 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 over 6 yearsWorking on 17.04
-
WinEunuuchs2Unix about 6 yearsOn my Ubuntu 16.04 LTS there is no
nvidia-common
package so the extra step ofsudo apt-get install ubuntu-desktop
can be omitted. Also there is no/etc/X11/xorg.conf
file. Runninglocate xorg.conf
reveals many files. -
Fabian Röling over 5 yearsThank you so much for saving my system! If this hadn't worked, I would have probably had to reinstall my entire system.
-
danShumway about 5 yearsWorked for me in Ubuntu 16.04 LTS, minus the need to reinstall ubuntu-desktop. This answer was a huge lifesaver for me.
-
Infinite Loops about 5 yearsnvidia-uninstall no longer supported. No command found in Disco Dingo
-
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 over 3 yearsYou 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 almost 3 yearswaht does the
^
do in your command? -
Charlie Parker almost 3 yearsI don't get it why am I doing
sudo apt-get install ubuntu-desktop
? -
Charlie Parker almost 3 yearswhy are you talking about
nouveau
? That is not related to removing nvidia-drivers... :/ -
Charlie Parker almost 3 yearswhy not just do
sudo apt-get --purge remove nvidia*
? -
Admin about 2 yearsuser383919 and your answer did the trick. thanks a lot
-
Admin about 2 yearsomg! its perfect! you save my night!