6

I have a Linux Mint 20.0 (Ulyana) Cinnamon, which is Ubuntu 20.04 (Focal) based.

Also tested and valid for Linux Mint 21.1 (Vera) Cinnamon, which is Ubuntu 22.04 (Jammy) based.


GPU: NVIDIA, GeForce GTX 1060, Max-Q Design, 6 GB GDDR5X VRAM

which has the basic specification as follows:

GeForce GTX 1060 specs


Objective

To install the latest available drivers without using any PPA (Personal Package Archive).


Status

If I run the integrated Mint's Driver Manager, I only see old versions available, an old example from the original question:

nvidia-driver-390

Vlastimil Burián
  • 27,586
  • 56
  • 179
  • 309

3 Answers3

13

Disclaimer - please read before you try installing anything

Today, I ran into an old laptop, with Nvidia Geforce GT 520M, which is not supported by the latest driver anymore, version 390 works fine though. Therefore, I must strongly recommend running a search on the Nvidia drivers page before you try to install any driver version!


Generic way - the recommended way


If you'd like to have the recommended packages installed too, then you could run this (the version was last updated on 2023-Jul-01):

sudo apt-get install --install-recommends nvidia-driver-535

I may not update the version anymore, so I will tell you instead, how to find out (manually) that there is a new version.

As there are many ways, the most comfortable for me is (as a normal user or root) typing to your terminal:

apt-cache policy nvidia-driver-4

and double-tapping the Tab, an example output follows:

nvidia-driver-418         nvidia-driver-440-server  nvidia-driver-460-server
nvidia-driver-418-server  nvidia-driver-450         nvidia-driver-465
nvidia-driver-430         nvidia-driver-450-server  nvidia-driver-470
nvidia-driver-435         nvidia-driver-455         nvidia-driver-470-server
nvidia-driver-440         nvidia-driver-460         

Linux Mint - Driver Manager - please AVOID

It may be possible to even use Mint's GUI Driver Manager for this. Generally, I like the command-line way much more, actually, I never use this GUI, because it does not tell you what is happening, you would just blindly look at the progress bar. Therefore I strongly recommend not using this tool, and doing the job via the terminal as shown above.


nvidia-driver-470 in Driver Manager in Linux Mint 20.2


Ubuntu way - NOT RECOMMENDED (!!!)


Thanks to the Ubuntu base, one can also take advantage of, which takes care of everything, but I do not recommend it due to one has no control over what happens, and things can break as a side effect, so the following I note only for completeness (click your mouse to show):

sudo ubuntu-drivers autoinstall

To only list drivers applicable to your system, you can do:

sudo ubuntu-drivers list

which will list all drivers available to install on your Ubuntu-based system.


2023 Updates & Notes

  1. How to find if a specific set of versions are available:

    apt-cache policy 'nvidia-driver-5*'
    

    Note the quotes! You need to quote this string.

  2. I myself ran into a black screen issue when running the install command above.

    Remember: DO NOT PANIC in this case. Wait for 10-30 minutes depending on how long the installation usually takes you. The install time depends largely on how powerful your computer is overall. If you usually hear fan noise like me, wait a couple of minutes after the fan stops. If you do wait enough time, the Nvidia driver will be installed correctly. In my case, I had to force shutdown after the wait by pressing the power button for several seconds. It booted correctly which you can prove with nvidia-smi command:

    +---------------------------------------------------------------------------------------+
    | NVIDIA-SMI 535.54.03              Driver Version: 535.54.03    CUDA Version: 12.2     |
    |-----------------------------------------+----------------------+----------------------+
    | GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
    | Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
    |                                         |                      |               MIG M. |
    |=========================================+======================+======================|
    |   0  NVIDIA GeForce GTX 1060 ...    Off | 00000000:01:00.0  On |                  N/A |
    | N/A   49C    P0              24W /  60W |    240MiB /  6144MiB |      0%      Default |
    |                                         |                      |                  N/A |
    +-----------------------------------------+----------------------+----------------------+
    +---------------------------------------------------------------------------------------+
    | Processes:                                                                            |
    |  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
    |        ID   ID                                                             Usage      |
    |=======================================================================================|
    |    0   N/A  N/A      1346      G   /usr/lib/xorg/Xorg                          166MiB |
    |    0   N/A  N/A      4476      G   cinnamon                                     23MiB |
    |    0   N/A  N/A     18948      G   ...ble-features=BlockInsecureDownloads       47MiB |
    +---------------------------------------------------------------------------------------+
    

    Or in GUI in Mint: nvidia-driver-535 in Driver Manager in Linux Mint 21.1

Vlastimil Burián
  • 27,586
  • 56
  • 179
  • 309
-1

With NVIDIA being a 3rd party / proprietary driver, they are never included in any linux distribution whether it is MINT, or RHEL, or SLES, or UBUNTU.

If you go to https://www.nvidia.com/en-us/drivers navigate to your model graphics card and for Operating System you will see the only relevant one being Linux 64-bit and in doing so will download a NVIDIA-Linux-x86_64-470.57.02.run file for example. I don't believe Nvidia distinguishes between any modern 64-bit linux, except for "solaris" and "freebsd". So it is this same .run file for rhel or sles or ubuntu or mint or whatever is a popular distro these days.

Having that file present on your system, change to runlevel 3 either by doing init 3 or if you are systemd based then systemcyl isolate multi-user.target. Then as root do a chmod 700 NVIDIA-Linux-x86_64-470.57.02.run followed by a ./NVIDIA-Linux-x86_64-470.57.02.run and simply step through the semi-graphical install which usually at the end prompts you if you want to run nvidia-xconfig {which will create an /etc/X11/xorg.conf file on a RHEL-7 system that previously was not present.}

This method I have used for ~5 years now reliably, the main points being

  • I have gotten the driver directly from the source, which is Nvidia
  • I have gotten the latest version
  • It works; at least in RHEL/CentOS 7 which is what I use now but it has worked for me back when I was using SLES/SuSE 11 and it should work for other distro's such as Mint or Ubuntu and so on.
    • if it doesn't work I would be interested in knowing so let me know in a comment.
    • know that you have to disable nouveau at least in RHEL/CentOS 7 and that is done by modifying /etc/default/grub and appending a modprobe.blacklist=nouveau to GRUB_CMDLINE_LINUX and then doing a grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg and a systemctl set-default multi-user.target followed by a reboot then installing the nvidia .run file and systemctl set-default graphical.target. Modify syntax here appropriately for linux distros other than rhel.
ron
  • 5,749
  • 7
  • 48
  • 84
  • It's worth mentioning, that when installed this way, you'd have to redo the steps after each kernel update, which can be extremely annoying to me at least. Source: [This AskUbuntu answer](https://askubuntu.com/a/149224/436624). The whole procedure seems inconvenient at best. – Vlastimil Burián Aug 04 '21 at 19:00
  • @ LinuxSecurityFreak : if you install **DKMS** then when nvidia installs it will state *I see DKMS is installed do you want to register Nvidia with it*. You say yes, and that solves that problem; yes losing the nvidia kernel module after every kernel update is annoying but DKMS is the solution to that. – ron Aug 04 '21 at 20:46
  • `The *whole* procedure is inconvenient but that's not my fault` see : https://www.youtube.com/watch?v=iYWzMvlj2RQ I'm just telling you the way I have done it which has been reliable for me and as streamlined as I have been able to make it; don't hate the messenger. – ron Aug 04 '21 at 20:50
-2

This works for me.

First I remove all the Nvidia drivers:

$ sudo dpkg --purge $(dpkg -l | grep nvidia | awk '{print $2}')
$ sudo dpkg --purge $(dpkg -l | grep libnvidia | awk '{print $2}')

After that, I install the latest version:

$ sudo apt-get install --install-recommends nvidia-driver-455

Note: Done on Linux Mint 19.3

Vlastimil Burián
  • 27,586
  • 56
  • 179
  • 309