我一直在尝试安装我的 NVIDIA 驱动程序,但是当尝试更改为专有驱动程序时,它会给我一个错误,提示驱动程序 455 的依赖关系未得到满足。我尝试了命令“sudo ubuntu-drivers autoinstall~”,但遇到了
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-455 : Depends: libnvidia-gl-455 (= 455.38-0ubuntu0.20.04.1) but it is not going to be installed
Depends: libnvidia-extra-455 (= 455.38-0ubuntu0.20.04.1) but it is not going to be installed
Depends: libnvidia-decode-455 (= 455.38-0ubuntu0.20.04.1) but it is not going to be installed
Depends: libnvidia-encode-455 (= 455.38-0ubuntu0.20.04.1) but it is not going to be installed
Depends: xserver-xorg-video-nvidia-455 (= 455.38-0ubuntu0.20.04.1) but it is not going to be installed
Depends: libnvidia-cfg1-455 (= 455.38-0ubuntu0.20.04.1) but it is not going to be installed
Depends: libnvidia-ifr1-455 (= 455.38-0ubuntu0.20.04.1) but it is not going to be installed
Depends: libnvidia-fbc1-455 (= 455.38-0ubuntu0.20.04.1) but it is not going to be installed
Recommends: libnvidia-compute-455:i386 (= 455.38-0ubuntu0.20.04.1)
Recommends: libnvidia-decode-455:i386 (= 455.38-0ubuntu0.20.04.1)
Recommends: libnvidia-encode-455:i386 (= 455.38-0ubuntu0.20.04.1)
Recommends: libnvidia-ifr1-455:i386 (= 455.38-0ubuntu0.20.04.1)
Recommends: libnvidia-fbc1-455:i386 (= 455.38-0ubuntu0.20.04.1)
Recommends: libnvidia-gl-455:i386 (= 455.38-0ubuntu0.20.04.1)
E: Unable to correct problems, you have held broken packages.
现在,我刚刚使用,sudo apt-get remove --purge nvidia-* -y
所以现在我根本没有驱动程序。有什么建议可以获取我的 GPU 驱动程序吗?
答案1
我同意@helpless child 的观点sudo apt purge libnvidia-gl-*
。
事实上,很难找出损坏的软件包依赖关系和冲突,并且版本经常发生冲突。
经过一番搜索,我把解决方案拼凑如下:
sudo apt purge
使用以下命令找到的所有内容:
(sudo apt autoremove
如有必要)
dpkg -l | grep nvidia
dpkg -l | grep cuda
dpkg -l | grep libcudnn
dpkg -l | grep libglvnd0
您可能无法通过自动完成或通配符 * 找到已安装的版本,但您可能会看到列出的冲突版本dpkg -l
。
然后,从驱动程序重新安装所有内容。
例如,就我的情况来说:
sudo apt install nvidia-utils-460
sudo apt install nvidia-driver-460
sudo apt install cuda-toolkit-11-1
sudo apt install libcudnn8-dev=8.0.5.39-1+cuda11.1
最后涉及的两个最相关的参考资料:
PS:
cuda-11-1
对比cuda-toolkit-11-1
对比cuda-tools-11-1
nvidia-driver-460
vsnvidia-drivers-460
vsnvidia-graphics-drivers-460
(apt 列出的无法找到后两个)nvidia-cuda-dev
,,nvidia-cuda-toolkit
等等等等。:P
答案2
对我来说,解决方案是手动删除每一个当前版本具有状态的包but it is not going to be installed
。
所以我的驱动程序版本是 440,但想要 455。我必须删除sudo apt purge libnvidia-gl-440
所有这些驱动程序,等等。之后错误消失,我可以安装 455。
答案3
我在 nvidia 设置和未知显示器方面遇到了同样的问题。因此我又使用 450 驱动程序sudo apt install nvidia-450
。这对我来说非常有效。如果 450 驱动程序不起作用,请尝试 440。
有趣的是,它ubuntu-drivers devices
显示推荐使用 455 驱动程序
vendor : NVIDIA Corporation
model : GP106 [GeForce GTX 1060 6GB]
driver : nvidia-driver-390 - distro non-free
driver : nvidia-driver-418-server - distro non-free
driver : nvidia-driver-450 - distro non-free
driver : nvidia-driver-440-server - distro non-free
driver : nvidia-driver-455 - distro non-free recommended
driver : nvidia-driver-450-server - distro non-free
driver : xserver-xorg-video-nouveau - distro free builtin
答案4
除了卸载这些软件包之外,您还可以检查哪些软件包被保留并取消保留。之后,您应该能够安装较新的驱动程序版本。
检查保存的 nvidia 包:
$ apt-mark showhold | grep nvidia
nvidia-compute-utils-460
nvidia-kernel-common-460
nvidia-kernel-source-460
nvidia-prime
nvidia-settings
nvidia-utils-460
取消保留需要更新的软件包:
$ sudo apt-mark unhold nvidia-compute-utils-460
Canceled hold on nvidia-compute-utils-460.
$ ...
在此之后,使用 apt 安装对我来说就可以了。