Ubuntu 18.04 的 Nvidia 驱动程序依赖性问题

Ubuntu 18.04 的 Nvidia 驱动程序依赖性问题

重新编辑:我想我可能安装了多个版本的 nvidia-driver,其中一些与我的系统不兼容。我遇到了一堆并发症。当我尝试时sudo apt upgrade。我明白了:

The following packages have unmet dependencies:
 libnvidia-ifr1-470 : Depends: libnvidia-gl-470 but it is not installed
 libnvidia-ifr1-470:i386 : Depends: libnvidia-gl-470:i386 but it is not installed
 nvidia-driver-470 : Depends: libnvidia-gl-470 (= 470.161.03-0ubuntu0.18.04.1) but it is not installed
                     Recommends: libnvidia-gl-470:i386 (= 470.161.03-0ubuntu0.18.04.1)
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

于是我按照吩咐做了:sudo apt --fix-broken install

Do you want to continue? [Y/n] Y
(Reading database ... 370884 files and directories currently installed.)
Preparing to unpack .../libnvidia-gl-470_470.161.03-0ubuntu0.18.04.1_i386.deb ...
diversion of /usr/lib/i386-linux-gnu/libGL.so.1 to /usr/lib/i386-linux-gnu/libGL.so.1.distrib by nvidia-340
dpkg-divert: error: mismatch on package
  when removing 'diversion of /usr/lib/i386-linux-gnu/libGL.so.1 by libnvidia-gl-470'
  found 'diversion of /usr/lib/i386-linux-gnu/libGL.so.1 to /usr/lib/i386-linux-gnu/libGL.so.1.distrib by nvidia-340'
dpkg: error processing archive /var/cache/apt/archives/libnvidia-gl-470_470.161.03-0ubuntu0.18.04.1_i386.deb (--unpack):
 new libnvidia-gl-470:i386 package pre-installation script subprocess returned error exit status 2
Preparing to unpack .../libnvidia-gl-470_470.161.03-0ubuntu0.18.04.1_amd64.deb ...
diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 to /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib by nvidia-340
dpkg-divert: error: mismatch on package
  when removing 'diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 by libnvidia-gl-470'
  found 'diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 to /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib by nvidia-340'
dpkg: error processing archive /var/cache/apt/archives/libnvidia-gl-470_470.161.03-0ubuntu0.18.04.1_amd64.deb (--unpack):
 new libnvidia-gl-470:amd64 package pre-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/libnvidia-gl-470_470.161.03-0ubuntu0.18.04.1_i386.deb
 /var/cache/apt/archives/libnvidia-gl-470_470.161.03-0ubuntu0.18.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我尝试sudo apt autoremove nvidia*

Package 'nvidia-libopencl1-304-updates' is not installed, so not removed
Package 'nvidia-opencl-icd-304' is not installed, so not removed
Package 'nvidia-opencl-icd-304-updates' is not installed, so not removed
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libnvidia-ifr1-470 : Depends: libnvidia-gl-470 but it is not going to be installed
 libnvidia-ifr1-470:i386 : Depends: libnvidia-gl-470:i386 but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

sudo apt purge nvidia*给出了同样的死胡同。如何解决这些依赖性问题并删除造成问题的多个 nvidia 驱动程序版本?我将不胜感激任何帮助。

我查看了我的“软件和更新”-->“其他软件”,我有一些 PPA,但不知道要删除什么: 软件和更新-->其他软件

相关内容