Linux Tutorials

[How To] Install Latest NVIDIA Drivers In Linux

how to install latest nvidia drivers in linux

Do you have an Nvidia graphics card on your desktop? That’s great until you are in need of the latest drivers especially when you are a gamer. Unlike Windows, Nvidia drivers for Linux desktops are quite hard to come by, and installing the latest drivers on your Linux desktop can be quite an arduous process. Fortunately for Linux users, there are the third-party graphics drivers PPA which keeps updated Nvidia drivers for installation.

The PPA is currently in testing but you can nonetheless get working drivers from here.

Installing Nvidia drivers in Ubuntu

In this tutorial, I am going to show you how to install the latest Nvidia drivers for your Linux desktop in a few steps. I’ll also see how to remove it should things not work out as expected.

​1. Determine the latest version of Nvidia driver available for your graphics card

Nvidia PPA

a. Visit the graphics drivers PPA homepage here and determine the latest versions of Nvidia drivers available which is ‘nvidia-390’ as of March 1, 2021.  

b. Verify that your graphics card is capable of running the latest drivers. You can search on this link to determine if your graphics card is supported by a driver version. Don’t be so particular about the version part after the dot (after, just make sure you’re supported on the main version 390.2.

Remove older Nvidia driver

​If your graphic is supported, you can go ahead and remove all previously installed Nvidia drivers on your system. Enter the following command in the terminal.

sudo apt-get purge nvidia*

3. Add the graphics drivers PPA​

Let us go ahead and add the graphics-driver PPA –

sudo add-apt-repository ppa:graphics-drivers
sudo apt-get update

4. Install (and activate) the latest Nvidia graphics drivers. Enter the following command to install the version of Nvidia graphics supported by your graphics card –

sudo apt-get install nvidia-390

5. Reboot your computer for the new driver to kick-in. You can check your installation status with the following command

lsmod | grep nvidia

If there is no output, then your installation has probably failed. It is also possible that the driver is not available in your system’s driver database. You can run the following command to check if your system is running on the open source driver nouveau. If the output is negative for nouveau, then all is well with your installation.

lsmod | grep nouveau

6. Prevent automatic updates that might break the drivers. You can do this in 2 ways –

a. By removing the graphics-drivers PPA from your software sourcesThis will depend on your distro. On Ubuntu, go to your software sources, and then other sources and remove all instances of the graphics-driver PPAs.

b. Or by blocking minor version updates. Enter the following command

sudo apt-mark hold nvidia-390

7. Uninstall nvidia drivers from Ubuntu​

Are you running into issues with the new drivers, you can easily remove it.

a. Remove the graphics-drivers PPA as indicated in the step above.

b. Enter the following command to completely remove the driver

sudo apt-get purge nvidia*

c. Reboot your PC for the open-source nouveau drivers to kick-in.

Upgrading nvidia drivers in Ubuntu

Once you add ppa to your system and install drivers, you’ll automatically receive updates once they’re made available in the PPA. So keep updating system to get the latest updates.

sudo apt update 
sudo apt upgrade

Install Nvidia drivers In Fedora

If you are using Fedora 29, Fedora 28 or Fedora 27 then follow this tutorial. If you are using any other version, try it out and let me know if it worked or not. I have not tested it on older versions of Fedora. For Ubuntu or derivatives, it was very easy to install through PPA. But in Fedora, we will download binary files and install Nvidia drivers. So you must download the correct drivers for your graphics card otherwise, it will not work.

Check your Nvidia graphics card –

lspci |grep -E "VGA|3D"

This command will show your machine’s graphics card information.

01:00.0 VGA compatible controller: NVIDIA Corporation GP107 [GeForce GTX 1050 Ti] (rev a1)

Download Nvidia drivers

Make the setup file executable

chmod +x

Update system and reboot

dnf update

Install dependencies

dnf install kernel-devel kernel-headers gcc make dkms acpid libglvnd-glx libglvnd-opengl libglvnd-devel pkgconfig

​Disable open-source Nouveau drivers

Edit /etc/modprobe.d/blacklist.conf & at last, past the following line to disable nouveau drivers –

blacklist nouveau

Edit grub file /etc/sysconfig/grub

​Type ‘rd.driver.blacklist=nouveau’ at the end of ‘GRUB_CMDLINE_LINUX=”…”‘.

GRUB_CMDLINE_LINUX=" rhgb quiet rd.driver.blacklist=nouveau" 


grub2-mkconfig -o /boot/grub2/grub.cfg 


grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

Uninstall open-source Nouveau drivers

dnf remove xorg-x11-drv-nouveau

Create initramfs

backup old initramfs

mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img 

create new initramfs

dracut /boot/initramfs-$(uname -r).img $(uname -r)

Reboot system

systemctl set-default

Install Nvidia drivers in Fedora


Now follow the simple setup to install and configure Nvidia drivers in the fedora system.​Thanks for reading, hope you find this tutorial useful. Share your thought with us in the comments.


Mike April 5, 2019 at 8:28 pm

I have an encrypted root drive and had a blank screen on reboot. Turns out the GUi was kind of blocked. I could still type in my hard drive unlock/boot password and get in after booting, but it’s annoying, so I followed the instructions here that fixed the issue by booting me into text mode every time

yash shukla July 12, 2019 at 7:19 pm

if not working then use “nvidia-driver-xxx”

abhishek September 4, 2019 at 6:14 am

Thanks a lot. Have been trying to install nvidia geforce drivers in Ubuntu 18.04. My screen has been freezing forever before installing nvidia drivers. Will give update if it freezes again.

Peter Mason September 21, 2019 at 1:34 pm

Excellent. Thank you very much for this.
One (very minor) quibble: in step 3, the comment “And update” is included as part of the command box. Not a biggy, but I thought you might like to know.
Thanks again. I’ve bookmarked your site.

CroVox October 3, 2019 at 3:55 pm

Worked perfectly! Thank you so much for the info!

Mohd Sohail August 4, 2019 at 2:49 pm

I’m glad that it worked for you. 🙂

JT January 3, 2020 at 8:16 pm

Not worked for me.
This is the new way now:
# First, detect the model of your nvidia graphic card and the recommended driver.
# To do so execute:
ubuntu-drivers devices
# To install the recommended driver execute:
sudo ubuntu-drivers autoinstall
# check card stats after installation:

Mohd Sohail August 4, 2019 at 2:50 pm

I’ve updated the article with the installation from executable file. So you can download the file and run it to start the nvidia drivers setup.

dave March 4, 2020 at 12:49 am

What does:

And update

Mean in step 3?

Sohail March 8, 2020 at 10:35 pm

It means you can update the repository at this point.

Sther Martins March 9, 2020 at 11:48 pm

I was able to install on Fedora 31 by downloading a version of, like other previous versions previously wrong.

ProDigit June 2, 2020 at 10:15 pm

Can an update be written for those who want to upgrade their Ubuntu 390 drivers to 400 series?

Michael Gallag July 2, 2020 at 11:52 am

Hi, thanks for your info. I don’t understand, though: you mentioned the PPA site, then the nVidia site, which seems to have downloads available. Or, at least files like this:
“”. Is that a driver for Linux? for Ubuntu? If so, why would we want to use the PPA drivers?
Then I need to find out how to install one of those packages!

Mohd Sohail August 4, 2019 at 4:21 pm

The article has been updated. Check out the article. If you want to install in Ubuntu, add the PPA, update the system and install or upgrade nvidia drivers. But if you want to install in Fedora or derivatives, then choose the second method. Download nvidia drivers from official website then install it.

ProDigit August 2, 2020 at 6:46 am

@Michael Gallag, This article is over 2 years old.
Current LTR drivers are 390, 410 are up to date, and 418 are beta drivers.
This article needs editing, but helped me install the latest 390 drivers.

Mohd Sohail August 4, 2019 at 2:52 pm

I’ve just updated the article and added a way to install nvidia drivers in fedora through setup file. Simply download it from official nvidia website run it and follow the setup.

max July 24, 2020 at 2:35 am

What about arch linux?

Sohail August 14, 2020 at 12:21 pm

Hi Max,

Do you want instructions for Arch Linux? Ok. I will soon update the article with the instructions.

Thank you!

Ken O'Neill October 4, 2020 at 9:59 pm

all went well until this for nvidia-304
$ sudo apt-get install nvidia-304
Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
nvidia-304 : Depends: xorg-video-abi-11 but it is not installable or
xorg-video-abi-12 but it is not installable or
xorg-video-abi-13 but it is not installable or
xorg-video-abi-14 but it is not installable or
xorg-video-abi-15 but it is not installable or
xorg-video-abi-18 but it is not installable or
xorg-video-abi-19 but it is not installable or
xorg-video-abi-20 but it is not installable or
Depends: xserver-xorg-core
E: Unable to correct problems, you have held broken packages.
i have but am clueless how to use it.

Joe November 2, 2020 at 1:43 pm

Worked fine for Nvidia 415 driver (Geforce 1070) with only a tiny modification:
sudo apt install nvidia-driver-415
The 410 driver might be better because it is a long-time supported version, but 415 works fine for me.

Mohd Sohail August 4, 2019 at 2:51 pm

Great! Glad to know that it worked for you.

thej September 21, 2020 at 8:23 pm

@joe where do you get this information? that 415 is for long-time support?


Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.