6

I'm trying to install the nvidia-driver for Debian.

I've read everywhere that the correct solution is to run sudo apt install nvidia-driver and the driver should install itself without problems.

However this command leaves me with the output

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-driver : Depends: nvidia-driver-libs (= 375.82-1~deb9u1) but it is not going to be installed
                 Depends: nvidia-driver-bin (= 375.82-1~deb9u1) but it is not going to be installed
                 Depends: xserver-xorg-video-nvidia (= 375.82-1~deb9u1) but it is not going to be installed
                 Depends: nvidia-vdpau-driver (= 375.82-1~deb9u1) but it is not going to be installed
                 Depends: nvidia-alternative (= 375.82-1~deb9u1)
                 Depends: nvidia-kernel-dkms (= 375.82-1~deb9u1) or
                          nvidia-kernel-375.82
                 Recommends: nvidia-settings (>= 375) but it is not going to be installed
                 Recommends: nvidia-persistenced
E: Unable to correct problems, you have held broken packages.

I've tried installing the missing dependencies (like sudo apt install nvidia-driver-libs) but this just results in

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-driver-libs : Depends: libgl1-nvidia-glvnd-glx (= 375.82-1~deb9u1) but it is not going to be installed or
                               libgl1-nvidia-glx (= 375.82-1~deb9u1) but it is not going to be installed
                      Depends: nvidia-egl-icd (= 375.82-1~deb9u1) but it is not going to be installed or
                               libegl1-nvidia (= 375.82-1~deb9u1) but it is not going to be installed
                      Recommends: nvidia-driver-libs-i386
                      Recommends: libopengl0-glvnd-nvidia but it is not going to be installed
                      Recommends: libglx-nvidia0 (= 375.82-1~deb9u1) but it is not going to be installed
                      Recommends: libgles-nvidia1 (= 375.82-1~deb9u1) but it is not going to be installed
                      Recommends: libgles-nvidia2 (= 375.82-1~deb9u1) but it is not going to be installed
                      Recommends: libnvidia-cfg1 (= 375.82-1~deb9u1) but it is not going to be installed
                  Recommends: nvidia-vulkan-icd (= 375.82-1~deb9u1) but it is not going to be installed

How do I install the nvidia-driver with apt?

1
  • 1
    Debian 10 just exhibited the same problem, and adding "contrib' to sources.list fixed the issue. Commented May 1, 2021 at 16:58

4 Answers 4

12

You need to enable the non-free repositories:

sudo sed -i.bak 's/stretch[^ ]* main$/& contrib non-free/g' /etc/apt/sources.list

Then run apt update and try your installation again. You’ll probably also need to install the kernel headers if you haven’t already:

sudo apt install linux-headers-$(uname -r)

See the full instructions on the Debian wiki.

4

I had a similar problem. I solved it by removing backports from sources

from this issue https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=906903

We have had this before ... having both stretch and stretch-backports enabled and trying to track stretch does not work currently for the nvidia driver ... too many changes w.r.t. libglvnd etc.

1
  • 1
    Thanks! This worked for me. Commented out stretch-backports from my /etc/apt/sources.list file
    – Tim
    Commented Mar 20, 2019 at 4:33
2

Since this doesn't have an accepted answer yet, I'll go ahead and chip in what worked for me. I was having a very similar issue, with many of the same packages complaining, but there were an additional two PreDepends issues that stretch-backports was not resolving. Turns out, in addition to the instructions in the wiki page Stephen posted (https://wiki.debian.org/NvidiaGraphicsDrivers), I needed to add contrib for stretch. That is, in /etc/apt/sources.list, I changed

deb http://ftp.us.debian.org/debian/ stretch main

to

deb http://ftp.us.debian.org/debian/ stretch main contrib

and ran apt update, after which i was able to install nvidia-drivers without issue.

4
  • Welcome to Unix.SE! Note that I had already mentioned adding contrib ;-). Commented Sep 14, 2018 at 20:55
  • Totally missed that and somehow only saw the non-free there! Guess I need to read the code lines a little more carefully next time xP Thanks for pointing that out! Commented Sep 21, 2018 at 16:20
  • @jacaseyclyde I am surprised by your answer, saying that you need contrib repositories, since nvidia-driver is in non-free.
    – Paradox
    Commented Mar 26, 2019 at 6:00
  • @Paradox I don't know why it worked, but it just worked for me.
    – user332602
    Commented Mar 9, 2020 at 18:32
0

I had the same problem under Debian 10 Buster and could solve it in two steps:

  1. installing backport for corresponding Nvidia GForce 700 series as described here.
  2. There is somehow a bug related to DKMS and it could be solve by using experimental Debian packages which is described here.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .