How to fix NVIDIA driver failure on Ubuntu

The Problems

  1. You installed Ubuntu on a computer with NVIDIA graphics card, but Compiz is not turned on in Unity.
  2. You installed NVIDIA drivers and now you have no desktop or X windows.
  3. You installed the drivers from NVIDIA’s website and you have no desktop or X windows.


Almost everyone who has a NVIDIA graphics card is afraid when Ubuntu updates or the driver updates. Because, you never know if the install or update will screw up your setup leaving you with no Compiz or even worse, no X windows!

There are tons of solutions for these problems online. Below is the solution which works for me consistently.

Step 1: Remove NVIDIA drivers

After booting, if you are seeing a blank display then try pressing Ctrl+Alt+F1, this should give you a terminal login.

The first step is to remove any or all of the NVIDIA drivers installed on the computer. They should not just be uninstalled, but every shred of their prior existence must be eradicated.

Purge, not just remove, all installed NVIDIA packages:

$ sudo apt-get purge nvidia-*

If you had installed a NVIDIA driver from their website, uninstall it using the shell script that it ships with. Already deleted that file? Too bad. Try with a newer version of driver that you can download.

You may still have some NVIDIA modules stuck in the kernel. First list the kernel modules:

$ dkms status

The output is of this form:

nvidia-current-updates, 304.64, 3.2.0-37-generic, x86_64: installed

Here nvidia-current-updates is the module name, 304.64 is the module version and 3.2.0-37-generic is the kernel version.

Remove all the nvidia modules. For example, to remove the above:

$ sudo dkms remove nvidia-current-updates/304.64 -k 3.2.0-37-generic

Step 2: Install NVIDIA drivers

Now install back the drivers. I highly recommend staying away from the drivers on NVIDIA’s website. For drivers that have been tested and packaged by Ubuntu volunteers, you have two options: current and current-updates.

current is what was well tested and shipped with the Ubuntu version you are using. It may be pretty old. current-updates is a package that is drawn from NVIDIA’s releases, but is tested and packaged by Ubuntu. This is pretty safe.

Depending on what you pick, the install is familiar:

$ sudo apt-get install nvidia-current-updates nvidia-settings-updates

I hope your NVIDIA drivers are working with your Ubuntu now. If not, I hope the wide web holds a solution to your problem.

Tried with: NVIDIA GeForce 9600 GT and Ubuntu 12.04 LTS

12 thoughts on “How to fix NVIDIA driver failure on Ubuntu

  1. Thank you for very helpful instruction. I got my PC and NVIDIA driver working following your instruction


  2. I had a black screen and after a long search I determined that it was because of the information returned by my display and the way that was interpreted. The popup on my display indicated that the input format was not compatible.
    Basically you have to “Force video mode without EDID information” – which implies updating your xorg.conf manually.


  3. Three years later and this still works. It totally fixed my ubuntu, except I had to run the command with the latest NVIDIA driver (ver. 367).
    After deleting and reinstalling, all I had to do was reboot and I got my GUI system back.

    Thanks bro.


  4. If you try to manually remove the dkms modules and they are still present when you make dkms status, just delete them by hand from /var/lib/dkms/nvidia*


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.