我在 Ubuntu 18.04 中遇到问题sudo apt upgrade
,出现此错误。
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... 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-cfg1-430 : Conflicts: libnvidia-cfg1-any
libnvidia-cfg1-440 : Conflicts: libnvidia-cfg1-any
libnvidia-compute-430 : Conflicts: libcuda-10.0-1
Conflicts: libcuda-10.0-1:i386
Conflicts: libcuda-10.1-1
Conflicts: libcuda-10.1-1:i386
Conflicts: libcuda-5.0-1
Conflicts: libcuda-5.0-1:i386
Conflicts: libcuda-5.5-1
Conflicts: libcuda-5.5-1:i386
Conflicts: libcuda-6.0-1
Conflicts: libcuda-6.0-1:i386
Conflicts: libcuda-6.5-1
Conflicts: libcuda-6.5-1:i386
Conflicts: libcuda-7.0-1
Conflicts: libcuda-7.0-1:i386
Conflicts: libcuda-7.5-1
Conflicts: libcuda-7.5-1:i386
Conflicts: libcuda-8.0-1
Conflicts: libcuda-8.0-1:i386
Conflicts: libcuda-9.0-1
Conflicts: libcuda-9.0-1:i386
Conflicts: libcuda-9.1-1
Conflicts: libcuda-9.1-1:i386
Conflicts: libcuda-9.2-1
Conflicts: libcuda-9.2-1:i386
Conflicts: nvidia-opencl-icd
Conflicts: nvidia-opencl-icd:i386
Breaks: libnvidia-compute-430:i386 (!= 430.50-0ubuntu0.18.04.2) but 440.100-0ubuntu0.18.04.1 is to be installed
libnvidia-compute-430:i386 : Breaks: libnvidia-compute-430 (!= 440.100-0ubuntu0.18.04.1) but 430.50-0ubuntu0.18.04.2 is to be installed
libnvidia-compute-440 : Conflicts: libcuda-10.0-1
Conflicts: libcuda-10.1-1
Conflicts: libcuda-5.0-1
Conflicts: libcuda-5.5-1
Conflicts: libcuda-6.0-1
Conflicts: libcuda-6.5-1
Conflicts: libcuda-7.0-1
Conflicts: libcuda-7.5-1
Conflicts: libcuda-8.0-1
Conflicts: libcuda-9.0-1
Conflicts: libcuda-9.1-1
Conflicts: libcuda-9.2-1
Conflicts: nvidia-opencl-icd
libnvidia-compute-440:i386 : Conflicts: libcuda-10.0-1
Conflicts: libcuda-10.1-1
Conflicts: libcuda-5.0-1
Conflicts: libcuda-5.5-1
Conflicts: libcuda-6.0-1
Conflicts: libcuda-6.5-1
Conflicts: libcuda-7.0-1
Conflicts: libcuda-7.5-1
Conflicts: libcuda-8.0-1
Conflicts: libcuda-9.0-1
Conflicts: libcuda-9.1-1
Conflicts: libcuda-9.2-1
Conflicts: nvidia-opencl-icd
libnvidia-decode-430 : Conflicts: libnvidia-decode
Conflicts: libnvidia-decode:i386
Breaks: libnvidia-decode-430:i386 (!= 430.50-0ubuntu0.18.04.2) but 440.100-0ubuntu0.18.04.1 is to be installed
libnvidia-decode-430:i386 : Breaks: libnvidia-decode-430 (!= 440.100-0ubuntu0.18.04.1) but 430.50-0ubuntu0.18.04.2 is to be installed
libnvidia-decode-440 : Conflicts: libnvidia-decode
libnvidia-decode-440:i386 : Conflicts: libnvidia-decode
libnvidia-encode-430 : Conflicts: libnvidia-encode
Conflicts: libnvidia-encode:i386
Breaks: libnvidia-encode-430:i386 (!= 430.50-0ubuntu0.18.04.2) but 440.100-0ubuntu0.18.04.1 is to be installed
libnvidia-encode-430:i386 : Breaks: libnvidia-encode-430 (!= 440.100-0ubuntu0.18.04.1) but 430.50-0ubuntu0.18.04.2 is to be installed
libnvidia-encode-440 : Conflicts: libnvidia-encode
libnvidia-encode-440:i386 : Conflicts: libnvidia-encode
libnvidia-fbc1-430 : Conflicts: libnvidia-fbc1
Conflicts: libnvidia-fbc1:i386
Breaks: libnvidia-fbc1-430:i386 (!= 430.50-0ubuntu0.18.04.2) but 440.100-0ubuntu0.18.04.1 is to be installed
libnvidia-fbc1-430:i386 : Breaks: libnvidia-fbc1-430 (!= 440.100-0ubuntu0.18.04.1) but 430.50-0ubuntu0.18.04.2 is to be installed
libnvidia-fbc1-440 : Conflicts: libnvidia-fbc1
libnvidia-fbc1-440:i386 : Conflicts: libnvidia-fbc1
libnvidia-gl-430 : Conflicts: libnvidia-gl
Conflicts: libnvidia-gl:i386
Breaks: libnvidia-gl-430:i386 (!= 430.50-0ubuntu0.18.04.2) but 440.100-0ubuntu0.18.04.1 is to be installed
libnvidia-gl-430:i386 : Breaks: libnvidia-gl-430 (!= 440.100-0ubuntu0.18.04.1) but 430.50-0ubuntu0.18.04.2 is to be installed
libnvidia-gl-440 : Conflicts: libnvidia-gl
libnvidia-gl-440:i386 : Conflicts: libnvidia-gl
libnvidia-ifr1-430 : Conflicts: libnvidia-ifr1
Conflicts: libnvidia-ifr1:i386
Breaks: libnvidia-ifr1-430:i386 (!= 430.50-0ubuntu0.18.04.2) but 440.100-0ubuntu0.18.04.1 is to be installed
libnvidia-ifr1-430:i386 : Breaks: libnvidia-ifr1-430 (!= 440.100-0ubuntu0.18.04.1) but 430.50-0ubuntu0.18.04.2 is to be installed
libnvidia-ifr1-440 : Conflicts: libnvidia-ifr1
libnvidia-ifr1-440:i386 : Conflicts: libnvidia-ifr1
nvidia-compute-utils-430 : Conflicts: nvidia-persistenced
nvidia-compute-utils-440 : Conflicts: nvidia-persistenced
nvidia-dkms-430 : Conflicts: nvidia-dkms-kernel
Conflicts: nvidia-dkms-kernel:i386
nvidia-dkms-440 : Conflicts: nvidia-dkms-kernel
Conflicts: nvidia-dkms-kernel:i386
nvidia-kernel-source-430 : Conflicts: nvidia-kernel-source
nvidia-kernel-source-440 : Conflicts: nvidia-kernel-source
nvidia-utils-430 : Conflicts: nvidia-smi
Conflicts: nvidia-utils
nvidia-utils-440 : Conflicts: nvidia-smi
Conflicts: nvidia-utils
xserver-xorg-video-nvidia-430 : Conflicts: nvidia-driver-binary
Conflicts: xorg-driver-binary
xserver-xorg-video-nvidia-440 : Conflicts: nvidia-driver-binary
Conflicts: xorg-driver-binary
E: Broken packages
看起来罪魁祸首是 nvidia 软件包。我nvidia-driver-430
通过 apt 安装,并用 锁定它sudo apt-mark hold nvidia-driver-430
。然后我通过 nvidia 网站(而不是通过apt
)安装了 Cuda 10 和 CuDNN。我该如何解决这个问题?
答案1
关注@doug 的评论。
我只需取消保留 nvidia-driver 包并更新我的 CUDA 和 CuDNN 安装即可。这解决了问题。