为什么在 Ubuntu 18.04 上安装 Nvidia 418 驱动程序时会出现未满足的依赖项错误?

为什么在 Ubuntu 18.04 上安装 Nvidia 418 驱动程序时会出现未满足的依赖项错误?

我已经设置了专有图形 PPA并成功运行apt update,但在尝试安装 Nvidia 418 驱动程序时出现以下错误:

$ sudo apt install nvidia-driver-418
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-418 : Depends: libnvidia-gl-418 (= 418.56-0ubuntu0~gpu18.04.1) but it is not going to be installed
                     Depends: nvidia-utils-418 (= 418.56-0ubuntu0~gpu18.04.1) but it is not going to be installed
                     Depends: xserver-xorg-video-nvidia-418 (= 418.56-0ubuntu0~gpu18.04.1) but it is not going to be installed
                     Depends: libnvidia-cfg1-418 (= 418.56-0ubuntu0~gpu18.04.1) but it is not going to be installed
                     Depends: libnvidia-ifr1-418 (= 418.56-0ubuntu0~gpu18.04.1) but it is not going to be installed
                     Recommends: libnvidia-decode-418:i386 (= 418.56-0ubuntu0~gpu18.04.1)
                     Recommends: libnvidia-encode-418:i386 (= 418.56-0ubuntu0~gpu18.04.1)
                     Recommends: libnvidia-ifr1-418:i386 (= 418.56-0ubuntu0~gpu18.04.1)
                     Recommends: libnvidia-fbc1-418:i386 (= 418.56-0ubuntu0~gpu18.04.1)
                     Recommends: libnvidia-gl-418:i386 (= 418.56-0ubuntu0~gpu18.04.1)
E: Unable to correct problems, you have held broken packages.

依赖关系肯定存在,例如:

$ sudo apt-cache showpkg xserver-xorg-video-nvidia-418
Package: xserver-xorg-video-nvidia-418
Versions: 
418.56-0ubuntu0~gpu18.04.1 (/var/lib/apt/lists/ppa.launchpad.net_graphics-drivers_ppa_ubuntu_dists_bionic_main_binary-amd64_Packages)
 Description Language: 
                 File: /var/lib/apt/lists/ppa.launchpad.net_graphics-drivers_ppa_ubuntu_dists_bionic_main_binary-amd64_Packages
                  MD5: a1eb1a42f08cae3b2102de9da0cd2b3b
 Description Language: en
                 File: /var/lib/apt/lists/ppa.launchpad.net_graphics-drivers_ppa_ubuntu_dists_bionic_main_i18n_Translation-en
                  MD5: a1eb1a42f08cae3b2102de9da0cd2b3b


Reverse Depends: 
  nvidia-driver-418,xserver-xorg-video-nvidia-418 418.56-0ubuntu0~gpu18.04.1
Dependencies: 
418.56-0ubuntu0~gpu18.04.1 - libnvidia-cfg1-418 (5 418.56-0ubuntu0~gpu18.04.1) xorg-video-abi-24 (16 (null)) xorg-video-abi-23 (16 (null)) xorg-video-abi-20 (16 (null)) xorg-video-abi-19 (16 (null)) xorg-video-abi-18 (16 (null)) xorg-video-abi-15 (16 (null)) xorg-video-abi-14 (16 (null)) xorg-video-abi-13 (16 (null)) xorg-video-abi-12 (16 (null)) xorg-video-abi-11 (16 (null)) xorg-video-abi-10 (16 (null)) xorg-video-abi-8 (16 (null)) xorg-video-abi-6.0 (0 (null)) xserver-xorg-core (18 2:1.19.6-1ubuntu2~) xserver-xorg-core-hwe-18.04 (0 (null)) libc6 (2 2.2.5) 
Provides: 
418.56-0ubuntu0~gpu18.04.1 - xorg-driver-video (= ) xorg-driver-binary (= ) nvidia-driver-binary (= ) 
Reverse Provides:

为什么 apt 不能自动安装这些依赖项?

答案1

似乎与我已经安装的软件包之间存在某种冲突nvidia-driver-390。如果我首先删除现有的 Nvidia 驱动程序包,如下所示,则nvida-driver-418软件包的安装将继续进行,不会出现任何问题:

$ sudo apt remove nvidia-driver-390 && sudo apt autoremove

相关内容