web-dev-qa-db-ja.com

パッケージマネージャーも破損しているように見える場合、破損したNVIDIAドライバーを修正するにはどうすればよいですか?

apt-getまたはaptで何かを行おうとすると、常に次のメッセージが表示されます。

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'nvidia-current' 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-396 : Depends: libnvidia-gl-396 but it is not going to be installed
 libnvidia-ifr1-396:i386 : Depends: libnvidia-gl-396:i386 but it is not going to be installed
 nvidia-driver-396 : Depends: libnvidia-gl-396 (= 396.24.02-0ubuntu0~gpu18.04.1) but it is not going to be installed
                     Recommends: libnvidia-gl-396:i386 (= 396.24.02-0ubuntu0~gpu18.04.1)
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

次に、apt --fix-broken installを試してみると、次のことがわかります。

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  lib32gcc1 libc6-i386
Use 'Sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libnvidia-gl-396 libnvidia-gl-396:i386
The following NEW packages will be installed:
  libnvidia-gl-396 libnvidia-gl-396:i386
0 upgraded, 2 newly installed, 0 to remove and 72 not upgraded.
3 not fully installed or removed.
Need to get 0 B/32.3 MB of archives.
After this operation, 147 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 236145 files and directories currently installed.)
Preparing to unpack .../libnvidia-gl-396_396.24.02-0ubuntu0~gpu18.04.1_i386.deb ...
dpkg-query: no packages found matching libnvidia-gl-390
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-396'
  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-396_396.24.02-0ubuntu0~gpu18.04.1_i386.deb (--unpack):
 new libnvidia-gl-396:i386 package pre-installation script subprocess returned error exit status 2
Preparing to unpack .../libnvidia-gl-396_396.24.02-0ubuntu0~gpu18.04.1_AMD64.deb ...
dpkg-query: no packages found matching libnvidia-gl-390
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-396'
  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-396_396.24.02-0ubuntu0~gpu18.04.1_AMD64.deb (--unpack):
 new libnvidia-gl-396:AMD64 package pre-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/libnvidia-gl-396_396.24.02-0ubuntu0~gpu18.04.1_i386.deb
 /var/cache/apt/archives/libnvidia-gl-396_396.24.02-0ubuntu0~gpu18.04.1_AMD64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

私もSudo dpkg --configure -aを試みましたが、エラーも発生しました:

dpkg: dependency problems prevent configuration of nvidia-driver-396:
 nvidia-driver-396 depends on libnvidia-gl-396 (= 396.24.02-0ubuntu0~gpu18.04.1); however:
  Package libnvidia-gl-396:AMD64 is not installed.

dpkg: error processing package nvidia-driver-396 (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.27-3ubuntu1) ...
dpkg: dependency problems prevent configuration of libnvidia-ifr1-396:AMD64:
 libnvidia-ifr1-396:AMD64 depends on libnvidia-gl-396; however:
  Package libnvidia-gl-396:AMD64 is not installed.

dpkg: error processing package libnvidia-ifr1-396:AMD64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libnvidia-ifr1-396:i386:
 libnvidia-ifr1-396:i386 depends on libnvidia-gl-396; however:
  Package libnvidia-gl-396:i386 is not installed.

dpkg: error processing package libnvidia-ifr1-396:i386 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 nvidia-driver-396
 libnvidia-ifr1-396:AMD64
 libnvidia-ifr1-396:i386

また、ドライバーnvidia-driver-396からnouveauドライバーに変更することもできません。どうすれば修正できますか? Ubuntu 18.04を使用しています。

1
James

Linux、LutrisでSteam、Playをインストールした後、同様の問題が発生しました。使用したプログラムまたはドライバーをアップグレード、削除、および/または削除します。

Sudo software-properties-gtk

「その他のソフトウェア」に移動して、Canonical Partners以外のすべてのドライバーを無効にします。

その後:

Sudo apt-get install -f
Sudo apt-get update
Sudo apt-get upgrade
Sudo apt autoremove

これで問題が解決します。しかし、次のコマンドでSteam、Linuxでプレイ、Lutrisを確実に削除してパージしました。 (他のすべてのプログラムにこれを使用することができます(-*プログラム名がその中のプログラム名を持つすべてのプロパティをパージした後))

Sudo apt-get remove --purge (program name)
1
gothsboss