Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
How to install NVIDIA video drivers in Elementary OS

First, download driver.

To be able to install your nvidia driver you have to remove your previous video driver with this code in a terminal window:

sudo apt-get remove nvidia* && sudo apt-get autoremove

After you finish with this one, you should also blacklist the nouveau driver by editing this file with either:

sudo vim /etc/modprobe.d/blacklist-nouveau.conf

And add these lines at the end:

blacklist nouveau
blacklist lbm-nouveau
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off

If, by any chance, there is no blacklist-nouveau.conf present in /etc/modprobe.d/, you can save your file as blacklist-nouveau.conf when prompted.

And you can also disable the Kernel Nouveau by typing these lines in a terminal window:

echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf

and after that

update-initramfs -u

Now you can reboot your computer, and when you get to the login prompt, press Ctrl+Alt+F1 to exit to the terminal console. Login with your username and password.

Go to the directory where you saved your nvidia driver using the command cd in the terminal console. Eg. cd nvidia considering that you are already in your user home directory after you login. You can use command dir to be able to see your exact driver's name.

To stop your display manager or the X server, you can type in the console this code:

sudo stop lightdm


sudo lightdm stop

If you are not using lightdm as your default display manager (DM), replace lightdm with your default display manager, which can be either kdm or gdm or whatever your display manager is.

You should get a message in the terminal console saying --> lightdm stopped/waiting

And now you can finally install the nvidia driver using a code similar to this one:

sudo sh    (for Ubuntu 64bit)  
sudo nvidia-xconfig

to save your new nvidia configuration in /etc/X11/xorg.conf.

You might need to install some extra software packages if nvidia installer gives an error and prompts for missing dependencies:

sudo apt-get install dkms fakeroot build-essential linux-headers-generic

But you need to install all these missing packages only if nvidia-installer can't do the job by itself.


This comment has been minimized.

Copy link

@willhs willhs commented Feb 9, 2016

This didn't work for me. Couldn't install DKMS module and on next startup got black screen


This comment has been minimized.

Copy link

@Faiz7412 Faiz7412 commented Mar 7, 2016

I agree with @willhs
I am facing black screen too after following this guide. And now I can't even access other ttys with alt+ctrl+f1


This comment has been minimized.

Copy link

@livmackintosh livmackintosh commented May 10, 2016

Worked great for me; note that you don't need to run nvidia-xconfig if you choose the option to create a config in the installer :)


This comment has been minimized.

Copy link

@FacundoTM FacundoTM commented Aug 12, 2016

Thanks, it works.


This comment has been minimized.

Copy link

@fragkopoulos fragkopoulos commented Sep 5, 2016

Thank you! Works great!
No need to run 'sudo nvidia-xconfig' because it is run automatically at the end of the installation.


This comment has been minimized.

Copy link

@dylanett dylanett commented May 6, 2017

To properly shutdown X before the installer would run I had to run
sudo service lightdm stop


This comment has been minimized.

Copy link

@ilyavoronin ilyavoronin commented Sep 12, 2020

Don't use this tutorial. You don't need to block nouveau to install nvidia drivers(at least I didn't do it). And if you fail to install nvidia driver you wouldn't be able to load into the os(to load the ui)
But if you used this tutorial and now nothing works, of course you can clear /etc/modprobe.d/blacklist-nouveau.conf and /etc/modprobe.d/nouveau-kms.conf in recovery mode, to return to nouveau driver.

I finally installed nvidia driver using this tutorial. But after following that instructions you still need to do two more steps:

  1. delete /etc/X11/xorg.conf
  2. run sudo update-initramfs -u

then reboot and everything should be fine. This solution was found here


This comment has been minimized.

Copy link
Owner Author

@jansanchez jansanchez commented Sep 14, 2020

Thank you for the clarification. @ilyavoronin


This comment has been minimized.

Copy link

@devopsception devopsception commented Oct 19, 2020

Hi, I have tried all the possible solution out there, but just want to confirm some concerns before proceeding with this one. Apparently, with my current installation of nvidia driver is causing alot of freezing problems. I install it it runs fine for 5 minutes and the display hangs and leaves the entire system unresponsive. It happened with all of the previous versions of nvidia drivers as well. Please, help me guide how can i properly install this driver so that I can actually use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment