我已经清除了 ubuntu 18.04 上所有与 nvidia 相关的驱动程序和依赖项。但是,在重新安装驱动程序时,运行时出现以下错误:sudo ubuntu-drivers autoinstall
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-440 : Depends: libnvidia-compute-440 (= 440.59-0ubuntu0.18.04.1) but 440.82-0ubuntu0~0.18.04.2 is to be installed
Depends: libnvidia-decode-440 (= 440.59-0ubuntu0.18.04.1) but it is not going to be installed
Depends: libnvidia-encode-440 (= 440.59-0ubuntu0.18.04.1) but it is not going 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-440:i386 (= 440.59-0ubuntu0.18.04.1)
Recommends: libnvidia-decode-440:i386 (= 440.59-0ubuntu0.18.04.1)
Recommends: libnvidia-encode-440:i386 (= 440.59-0ubuntu0.18.04.1)
Recommends: libnvidia-ifr1-440:i386 (= 440.59-0ubuntu0.18.04.1)
Recommends: libnvidia-fbc1-440:i386 (= 440.59-0ubuntu0.18.04.1)
Recommends: libnvidia-gl-440:i386 (= 440.59-0ubuntu0.18.04.1)
E: Unable to correct problems, you have held broken packages.
有办法修复这个问题吗?谢谢。
我认为这可能会有帮助:
$dpkg -l | grep -i nvidia
rc cuda-nvtx-10-1 10.1.243-1 amd64 NVIDIA Tools Extension
rc libnvidia-compute-435:amd64 435.21-0ubuntu0.18.04.2 amd64 NVIDIA libcompute package
ii libnvidia-compute-440:amd64 440.82-0ubuntu0~0.18.04.2 amd64 NVIDIA libcompute package
这些是我的附加存储库:
答案1
我遇到了同样的问题,我通过尝试直接安装依赖项解决了这个问题。我从顶部开始,一直到找到可以安装的依赖项。
以下是我所拥有的:
nvidia-driver-440 : Depends: libnvidia-gl-440 (= 440.82-0ubuntu0~0.18.04.2) but it is not going to be installed
Depends: nvidia-kernel-source-440 (= 440.82-0ubuntu0~0.18.04.2) but it is not going to be installed
Depends: libnvidia-decode-440 (= 440.82-0ubuntu0~0.18.04.2) but it is not going to be installed
Depends: libnvidia-encode-440 (= 440.82-0ubuntu0~0.18.04.2) but it is not going to be installed
Depends: nvidia-utils-440 (= 440.82-0ubuntu0~0.18.04.2) but it is not going to be installed
Depends: xserver-xorg-video-nvidia-440 (= 440.82-0ubuntu0~0.18.04.2) but it is not going to be installed
Depends: libnvidia-cfg1-440 (= 440.82-0ubuntu0~0.18.04.2) but it is not going to be installed
Depends: libnvidia-ifr1-440 (= 440.82-0ubuntu0~0.18.04.2) but it is not going to be installed
Recommends: libnvidia-decode-440:i386 (= 440.82-0ubuntu0~0.18.04.2)
Recommends: libnvidia-encode-440:i386 (= 440.82-0ubuntu0~0.18.04.2)
Recommends: libnvidia-ifr1-440:i386 (= 440.82-0ubuntu0~0.18.04.2)
Recommends: libnvidia-fbc1-440:i386 (= 440.82-0ubuntu0~0.18.04.2)
Recommends: libnvidia-gl-440:i386 (= 440.82-0ubuntu0~0.18.04.2)
E: Unable to correct problems, you have held broken packages.
首先我尝试安装libnvidia-gl-440
(列表中的第一个项目):
sudo apt install libnvidia-gl-440
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:
libnvidia-gl-440 : Depends: libnvidia-compute-440 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
这失败了,但只libnvidia-compute-440
列出了一个依赖项。
安装libnvidia-compute-440
:
sudo apt install libnvidia-compute-440
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libnvidia-cfg1-390 libnvidia-common-390 libnvidia-fbc1-390 libnvidia-fbc1-390:i386 libnvidia-gl-390 libnvidia-gl-390:i386 libnvidia-ifr1-390 libnvidia-ifr1-390:i386 libwayland-client0:i386
libwayland-server0:i386 nvidia-dkms-390 nvidia-kernel-common-390 nvidia-kernel-source-390 nvidia-prime nvidia-settings postgresql-client-9.3 screen-resolution-extra xserver-xorg-video-nvidia-390
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
libcuda1-361 libcuda1-367 libcuda1-375 libcuda1-384 libnvidia-compute-390 libnvidia-compute-390:i386 libnvidia-decode-390 libnvidia-decode-390:i386 libnvidia-encode-390 libnvidia-encode-390:i386
nvidia-352 nvidia-361 nvidia-367 nvidia-375 nvidia-384 nvidia-compute-utils-390 nvidia-driver-390 nvidia-headless-390 nvidia-headless-no-dkms-390 nvidia-opencl-icd-361 nvidia-opencl-icd-367
nvidia-opencl-icd-375 nvidia-opencl-icd-384 nvidia-utils-390
The following NEW packages will be installed:
libnvidia-compute-440
0 upgraded, 1 newly installed, 24 to remove and 0 not upgraded.
Need to get 20.9 MB of archives.
After this operation, 73.4 MB disk space will be freed.
这个被接受了。安装完成后,我重试了libnvidia-gl-440
,然后nvidia-driver-440
两个都被接受了,没有任何问题。
因此,只需逐步检查每个依赖项并遵循它们的依赖关系。
答案2
删除 cuda repos 存储库。它很可能会破坏依赖关系。
nvidia-driver-440
该 repo 中的包需要错误的依赖项。