为 Debian Stretch 安装 NVIDIA 驱动程序

为 Debian Stretch 安装 NVIDIA 驱动程序

我正在尝试为 Debian 安装 nvidia 驱动程序。

我到处都读到正确的解决方案是运行sudo apt install nvidia-driver并且驱动程序应该毫无问题地自行安装。

然而这个命令给我留下了输出

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.

我尝试安装缺少的依赖项(例如sudo apt install nvidia-driver-libs),但这只会导致

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

如何使用nvidia-driverapt 安装?

答案1

您需要启用非免费存储库:

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

然后运行apt update并再次尝试安装。如果您还没有安装内核头文件,您可能还需要安装:

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

Debian wiki 上的完整说明

答案2

我有类似的问题。我通过从源中删除向后移植来解决它

从这个问题https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=906903

我们以前遇到过这种情况...启用拉伸和拉伸向后移植并尝试跟踪拉伸目前对于 nvidia 驱动程序不起作用...对 libglvnd 等进行了太多更改。

答案3

由于这还没有一个公认的答案,我将继续并补充对我有用的内容。我遇到了一个非常相似的问题,许多相同的软件包都在抱怨,但还有另外两个PreDepends问题stretch-backports没有解决。事实证明,除了 Stephen 发布的 wiki 页面中的说明之外(https://wiki.debian.org/NvidiaGraphicsDrivers),我需要为stretch.也就是说,在/etc/apt/sources.list,我改变了

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

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

并运行apt update,之后我就可以nvidia-drivers毫无问题地安装了。

答案4

我在 Debian 10 Buster 下遇到了同样的问题,可以通过两步解决:

  1. 按照所述安装相应 Nvidia GForce 700 系列的向后移植这里
  2. 存在与 DKMS 相关的错误,可以通过使用实验性 Debian 软件包来解决,如下所述这里

相关内容