如何安装元包及其依赖项的特定版本?

如何安装元包及其依赖项的特定版本?

我将使用 NVIDIA 460 驱动程序作为示例。以下是当我尝试安装版本 460.67 而不是 460.80(即越野车, 供参考)。

$ apt-get install -s nvidia-driver-460=460.67-0ubuntu1
NOTE: This is only a simulation!
      apt-get needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree... Done
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 resolve the situation:

The following packages have unmet dependencies:
 nvidia-driver-460 : Depends: libnvidia-gl-460 (= 460.67-0ubuntu1) but 460.80-0ubuntu0.21.04.2 is to be installed
                     Depends: nvidia-dkms-460 (<= 460.67-1)
                     Depends: nvidia-kernel-common-460 (<= 460.67-1) but 460.80-0ubuntu0.21.04.2 is to be installed
                     Depends: nvidia-kernel-source-460 (= 460.67-0ubuntu1) but 460.80-0ubuntu0.21.04.2 is to be installed
                     Depends: libnvidia-compute-460 (= 460.67-0ubuntu1) but 460.80-0ubuntu0.21.04.2 is to be installed
                     Depends: libnvidia-extra-460 (= 460.67-0ubuntu1) but 460.80-0ubuntu0.21.04.2 is to be installed
                     Depends: nvidia-compute-utils-460 (= 460.67-0ubuntu1) but 460.80-0ubuntu0.21.04.2 is to be installed
                     Depends: libnvidia-decode-460 (= 460.67-0ubuntu1) but 460.80-0ubuntu0.21.04.2 is to be installed
                     Depends: libnvidia-encode-460 (= 460.67-0ubuntu1) but 460.80-0ubuntu0.21.04.2 is to be installed
                     Depends: nvidia-utils-460 (= 460.67-0ubuntu1) but 460.80-0ubuntu0.21.04.2 is to be installed
                     Depends: xserver-xorg-video-nvidia-460 (= 460.67-0ubuntu1) but 460.80-0ubuntu0.21.04.2 is to be installed
                     Depends: libnvidia-cfg1-460 (= 460.67-0ubuntu1) but 460.80-0ubuntu0.21.04.2 is to be installed
                     Depends: libnvidia-ifr1-460 (= 460.67-0ubuntu1) but 460.80-0ubuntu0.21.04.2 is to be installed
                     Depends: libnvidia-fbc1-460 (= 460.67-0ubuntu1) but 460.80-0ubuntu0.21.04.2 is to be installed
                     Recommends: nvidia-settings but it is not going to be installed
                     Recommends: nvidia-prime (>= 0.8) but it is not going to be installed
                     Recommends: libnvidia-compute-460:i386 (= 460.67-0ubuntu1)
                     Recommends: libnvidia-decode-460:i386 (= 460.67-0ubuntu1)
                     Recommends: libnvidia-encode-460:i386 (= 460.67-0ubuntu1)
                     Recommends: libnvidia-ifr1-460:i386 (= 460.67-0ubuntu1)
                     Recommends: libnvidia-fbc1-460:i386 (= 460.67-0ubuntu1)
                     Recommends: libnvidia-gl-460:i386 (= 460.67-0ubuntu1)
E: Unable to correct problems, you have held broken packages.

这只是我目前能想到的一个例子。

我是否必须列出所有想要安装的软件包?

答案1

来自@user.dz:

最好使用aptitude. ,它有助于自动跟踪满足要求的每个软件包的顶级版本。否则,您必须使用 apt 逐一列出它们。类似于这种情况:askubuntu.com/q/900536/26246

就我而言,我选择了不同的路线(您可以在我的帖子中看到链接)。

相关内容