View Full Version : failed uninstalling all nvidia drivers

April 29th, 2018, 07:29 AM
My system: ubuntu 1604 64 bit, i7, titan x, multiboot with 14.04 and windows

I need to reinstall nvidia drivers on 16.04. I had unsuccessfully tried to install various versions of nvidia drivers from 384, 390, 396.

So I tried to remove existing nvidia installation using :

sudo ap-get remove --purge nvidia-*.

However when I search I found many nvidia files in /. How do I remove them. Is it safe to remove all of them?


April 30th, 2018, 02:48 AM
Hello, have you executed your commands in the recovery mode when uninstalling nvidia drivers? You may enter the recovery mode in the grub menu.

April 30th, 2018, 04:43 AM
It looks like you need to purge old kernels. Run this without the -s after testing it with the -s.
Check current kernel I also keep one older just in case:
#Current kernel:
uname -a
# kernels, shows older also?
dpkg --list | grep linux-image
-s is simulate so you can see what it will do, then run without -s
sudo apt-get -s autoremove

nVidia Must purge & install correct driver

April 30th, 2018, 07:18 AM
Thanks oldfred for replying i have been struggling for nearly two days now.

To begin with I was facing the ubuntu login loop problem. So I need to reinstall nvidia drivers. I have uninstalled the existing drivers using your method as below: I removed old kernels using sudo apt-get autoremove before uninstalling the nvidia driver

sudo apt-get remove --purge nvidia-*
sudo apt-get purge nvidia* bumblebee primus bbswitch-dkms
sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.backup

Then I try to install nvidia-390(it supports linux 64bits (mine is ubuntu 16.04,64bit) and gtx titanx)

I use :sudo apt-get install nvidia-390

But it gets back login loop. I tried all suggestions from various forms. I have tried with multiple drivers: 384, 390, 396. I keep getting the same message. The results from various command are as below: Some which seemed to be important are marked in bold

cat .xsession-errors:
Xlib: extension "GLX" missing onn display ":0"
Xlib: extension "GLX" missing onn display ":0"
OpenConnection:connect:No such file or directory

Output of dpkg -l | grep glx:


lspci -vk | grep -iA15 vga|grep Kernel gives:

Kernel modules: nvidiafb, nouveau, nvidia-390,nvidia-390-drm

However nouveau is blacklisted in /etc/modprobe.d/blacklist.conf

There is another file generated by nvidia called "nvidia-graphics-drivers.conf" which blacklists
nouveau, lbm--nouveau, nvidia-current, nvidia-173,nvidia-96, nvidia-current-updates, nvidia-173-updates, nvidia-96-updates,nvidia-390-updates,
It sets options nvidia_390_drv modeset=0

Output of
lsmod | egrep -i 'nvidia|nouveau|video':
video 40960 0

sudo lshw -n -c video gives:

*-display UNCLAIMED
description: VGA compatible controller
vendor NVIDIA corporation [10E]
configuartion: latency=0

April 30th, 2018, 03:46 PM
Not familar with Titan nVidia card.
Is it this? Which worked.

This shows newest driver should be correct for Titan.

If you add ppa, you get the very newest drivers also.

#What is installed
dpkg -l | grep -i nvidia
dkms status
lsmod | grep nvidia

# Shows standard repository versions, which is the same as
System Settings, Software & Updates icon, Additional drivers tab
ubuntu-drivers devices

Details on why and future incorporation to Ubuntu installer
sudo apt-add-repository ppa:graphics-drivers/ppa
# should show newest versions available in addition
ubuntu-drivers devices

If you do install a new driver, be sure to purge again before hand.

April 30th, 2018, 05:48 PM
the titan x card is as shown in https://www.phoronix.com/scan.php?pa...-titan-x&num=1 (https://www.phoronix.com/scan.php?page=article&item=nvidia-titan-x&num=1)

the drivers 390,396, 384 all support the titanx card as shown in nvidia drivers: supported devices

dpkg -l | grep -i nvidia gives:

nvidia-390 : 390.48

dkms status gives:

bbswitch,0.8,4.4.0-122-generic, x86_64: installed

lsmod | grep nvidia gave no ouput

ls -la .Xauthority

-rw------ 1 user user .Xauthority

ls -la .Iceauthority

-rw------ 1 user user .Iceauthority

the ppa is already added which suggested three drivers: 396, 390,384: I tried all three after purging the previous one(sudo apt-get remove --purge)
But all of them gave in xsession.errors :
Xlib: extension "GLX" missing onn display ":0"

April 30th, 2018, 07:12 PM
I am confused on bbswitch. I thought that was just for bumblebee and laptops with switchable graphics. And newer nVidia did not need bumblebee.

I have before suggested removing that, but it kept getting installed, so did not seem to solve issue.
But I might try removing it.

sudo apt-get purge nvidia* bumblebee primus bbswitch-dkms

I have this in my notes from at least a couple of years ago.

Bumblebee may not be required with nVidia Optimus which is installed automatically with newest nVidia driver.
Bumblebee has been depreciated in favor of nvidia-prime
Bumblebee - allows both nVidia & Intel to be used, nVidia Prime was just nVidia, but now updated:

May 2nd, 2018, 07:50 AM
I tried reinstalling nvidia.

Then I tried sudo dpkg-reconfigure nvidia-90 to regnerate ko filesas advised in https://devtalk.nvidia.com/default/topic/996318/ubuntu-16-04-stuck-in-login-loop-after-attempting-to-install-nvidia-linux-x86_64-375-39-run/
It still says that : extension "GLX" missing pn display 0

May 2nd, 2018, 03:11 PM
Do not know that error.
One fix for a laptop user was to add bumblebee, which I thought now was not used.
Another had two video cards and no UEFI/BIOS setting to control which was in use.
Check that monitor cable is correct.

#What is installed
dkms status