我正在尝试重新安装 nvidia 驱动程序 + cuda。我已经安装了 440 的驱动程序,但不小心安装了 cuda-11,它安装了 450 的驱动程序,搞乱了我的系统。现在我试图通过 清除我的所有驱动程序sudo apt-get remove --purge '^nvidia-.*'
。但是,我收到以下错误
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
cuda-drivers-450 : Depends: libnvidia-compute-450 (>= 450.36.06) but it is not going to be installed
Depends: nvidia-compute-utils-450 (>= 450.36.06) but it is not going to be installed
Depends: nvidia-dkms-450 (>= 450.36.06) but it is not going to be installed
Depends: nvidia-driver-450 (>= 450.36.06) but it is not going to be installed
Depends: nvidia-kernel-common-450 (>= 450.36.06) but it is not going to be installed
Depends: nvidia-kernel-source-450 (>= 450.36.06) but it is not going to be installed
Depends: nvidia-utils-450 (>= 450.36.06) but it is not going to be installed
Depends: nvidia-modprobe (>= 450.36.06)
Depends: nvidia-settings (>= 450.36.06) but it is not going to be installed
libnvidia-decode-450 : Depends: libnvidia-compute-450 (= 450.36.06-0ubuntu1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
无论我做什么,无论我运行apt --fix-broken install
还是清除其他包,我似乎总是会收到这个错误。
我看到过很多帖子都遇到了类似的问题(见下面的链接)——但我看到的唯一解决方案是重新安装 ubuntu(这不是一个可取的选择)。我看到过一篇帖子建议如何手动删除损坏的软件包,有人成功了吗?
http://www.piprime.fr/1480/manually-remove-broken-package-debian-ubuntu/
答案1
实际上,我认为我已经解决了这个问题。我可以手动遍历依赖关系树
sudo dpkg --remove --force-remove-reinstreq cuda
sudo dpkg --remove --force-remove-reinstreq cuda-11-0
sudo dpkg --remove --force-remove-reinstreq cuda-runtime-11-0
sudo dpkg --remove --force-remove-reinstreq cuda-demo-suite-11-0
sudo dpkg --remove --force-remove-reinstreq nvidia-driver-450
sudo dpkg --remove --force-remove-reinstreq cuda-drivers-450
sudo dpkg --remove --force-remove-reinstreq nvidia-driver-450
sudo apt purge *nvidia*
所以现在我可以删除所有 nvidia 驱动程序了。grrr
答案2
我从 Nvidia 下载安装了驱动程序。我调用下面
sudo nvidia-卸载
它会彻底删除所有 nvidia 驱动程序。