升级到 19.04 后,我遇到了 Nvidia 软件包问题

升级到 19.04 后,我遇到了 Nvidia 软件包问题

因此,在我格式化硬盘并进行全新安装(就像我 6 个月前做的那样)之前,是否有一个神奇的命令可以解决此问题?我应该指出 Nvidia 驱动程序运行良好(nvidia-driver-418),我现在可以很好地玩原生游戏和仅限 Windows 的游戏,但是:

sudo apt autoremove

the following packages have unmet dependencies.
 libnvidia-decode-418 : Depends: libnvidia-compute-418 (= 418.56-0ubuntu1) but it is not installed
 libnvidia-decode-418:i386 : Depends: libnvidia-compute-418:i386 (= 418.56-0ubuntu1) but it is not installed
 libnvidia-gl-418 : Depends: libnvidia-compute-418 but it is not installed
 nvidia-compute-utils-418 : Depends: libnvidia-compute-418 but it is not installed
 nvidia-driver-418 : Depends: libnvidia-compute-418 (= 418.56-0ubuntu1) but it is not installed
                     Recommends: libnvidia-compute-418:i386 (= 418.56-0ubuntu1)
 nvidia-utils-418 : Depends: libnvidia-compute-418 but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

进而...

sudo apt --fix-broken install

dpkg: error processing archive /var/cache/apt/archives/libnvidia-compute-410_418.56-0ubuntu1_amd64.deb (--unpack):
 package libnvidia-compute-410:amd64 (418.56-0ubuntu1) with field 'Multi-Arch: no' is not co-installable with libnvidia-compute-410 which has multiple installed instances
dpkg: regarding .../libnvidia-compute-418_418.56-0ubuntu1_amd64.deb containing libnvidia-compute-418:amd64:
 libnvidia-compute-418 conflicts with libcuda-10.0-1
  libnvidia-compute-410:amd64 provides libcuda-10.0-1 and is present and installed.

dpkg: error processing archive /var/cache/apt/archives/libnvidia-compute-418_418.56-0ubuntu1_amd64.deb (--unpack):
 conflicting packages - not installing libnvidia-compute-418:amd64
dpkg: regarding .../libnvidia-compute-418_418.56-0ubuntu1_i386.deb containing libnvidia-compute-418:i386:
 libnvidia-compute-418:i386 conflicts with libcuda-10.0-1
  libnvidia-compute-410:amd64 provides libcuda-10.0-1 and is present and installed.

dpkg: error processing archive /var/cache/apt/archives/libnvidia-compute-418_418.56-0ubuntu1_i386.deb (--unpack):
 conflicting packages - not installing libnvidia-compute-418:i386
Errors were encountered while processing:
 /var/cache/apt/archives/libnvidia-compute-410_418.56-0ubuntu1_amd64.deb
 /var/cache/apt/archives/libnvidia-compute-418_418.56-0ubuntu1_amd64.deb
 /var/cache/apt/archives/libnvidia-compute-418_418.56-0ubuntu1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我尝试过的每个 sudo apt 命令都因包依赖关系损坏而无法执行任何操作。

那么,是否有 sudo remove-all-the-broken-stuff 命令?

不久前我确实安装了一些 CUDA 软件包,但事实证明我并不需要。我只需要现在(2019 年 4 月)应该与 Ubuntu 19.04 一起安装的任何 Nvidia 图形驱动程序,而不需要任何非必要的 Nvidia/CUDA 软件包。如何在不格式化硬盘的情况下完成此操作?

更新:看起来像已确认错误

答案1

回答我自己的问题;-) 目前的解决方案已确认错误

  • 备份文件/var/lib/dpkg/status
  • 以超级用户身份编辑文件,查找以 开头的每个部分"Package: libnvidia-compute-410",不仅删除该行,还删除该部分。可能不止一个。
  • 保存文件并发出命令sudo apt-get --fix-broken install,现在不应该抱怨
  • 然后你可以继续sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
  • 重新启动后,您可能会拥有非 Nvidia 驱动程序,因此请转到软件和更新>附加驱动程序并安装您选择的 Nvidia 驱动程序...然后再次重新启动。

(这不是官方的修复方法,只是有人想出的解决方法)

相关内容