NVIDIAのインストール後に破損したパッケージを削除できない

NVIDIAのインストール後に破損したパッケージを削除できない

次のように、間違ったNVIDIAドライバをすべて削除してみました。apt-get remove nvidia*

ただし、今すぐパッケージをインストールしようとすると、次のメッセージが表示されます。

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 glx-alternative-nvidia : Depends: glx-diversions (= 0.8.0)
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

次に、 --fix-broken を使用します。

apt-get --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:
  libcublas8.0 libcudart8.0 libcufft8.0 libcufftw8.0 libcurand8.0 libcusolver8.0 libcusparse8.0 libnppc8.0
  libnppi8.0 libnppial8.0 libnppicc8.0 libnppicom8.0 libnppidei8.0 libnppif8.0 libnppig8.0 libnppim8.0
  libnppist8.0 libnppisu8.0 libnppitc8.0 libnpps8.0 libnvblas8.0 libnvgraph8.0 libnvidia-compiler
  libnvidia-fatbinaryloader libnvidia-fatbinaryloader:i386 libnvidia-ptxjitcompiler
  libnvidia-ptxjitcompiler:i386 libnvrtc8.0 libnvtoolsext1 libnvvm3 libopengl0:i386 libthrust-dev libvdpau-dev
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
Need to get 0 B/10.5 kB of archives.
After this operation, 0 B of additional disk space will be used.
dpkg: dependency problems prevent configuration of glx-alternative-nvidia:
 glx-alternative-nvidia depends on glx-diversions (= 0.8.0); however:
  Package glx-diversions is not installed.

dpkg: error processing package glx-alternative-nvidia (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of nvidia-alternative:
 nvidia-alternative depends on glx-alternative-nvidia (>= 0.7); however:
  Package glx-alternative-nvidia is not configured yet.

dpkg: error processing package nvidia-alternative (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 glx-alternative-nvidia
 nvidia-alternative
E: Sub-process /usr/bin/dpkg returned an error code (1)

パッケージを削除しようとすると:

apt-get remove glx-alternative-nvidia
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 nvidia-alternative : Depends: glx-alternative-nvidia (>= 0.7)
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

ソース、リスト:

cat /etc/apt/sources.list
deb http://http.kali.org/kali kali-rolling main contrib non-free
deb-src http://http.kali.org/kali kali-rolling main contrib non-free
#deb http://repo.xplico.org/ kali-rolling main

DPKG --configure -a && apt アップデート:

root@Anonymous:~# dpkg --configure -a
dpkg: dependency problems prevent configuration of glx-alternative-nvidia:
 glx-alternative-nvidia depends on glx-diversions (= 0.8.0); however:
  Package glx-diversions is not installed.

dpkg: error processing package glx-alternative-nvidia (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of nvidia-alternative:
 nvidia-alternative depends on glx-alternative-nvidia (>= 0.7); however:
  Package glx-alternative-nvidia is not configured yet.

dpkg: error processing package nvidia-alternative (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 glx-alternative-nvidia
 nvidia-alternative
root@Anonymous:~# apt update
Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://packages.microsoft.com/repos/vscode stable InRelease          
Hit:3 http://dl.google.com/linux/chrome/deb stable Release                                            
Hit:4 https://deb.nodesource.com/node_8.x jessie InRelease                                            
Hit:6 http://ftp2.nluug.nl/os/Linux/distr/kali kali-rolling InRelease           
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
root@Anonymous:~# 

猫/etc/apt/sources.list.d/*:

cat /etc/apt/sources.list.d/*
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
deb https://deb.nodesource.com/node_8.x jessie main
deb-src https://deb.nodesource.com/node_8.x jessie main
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main

dpkg --remove --force-remove-reinstreq nvidia-alternative:

dpkg --remove --force-remove-reinstreq nvidia-alternative
dpkg: dependency problems prevent removal of nvidia-alternative:
 nvidia-driver-bin depends on nvidia-alternative (= 375.82-7).
 libgles-nvidia1:i386 depends on nvidia-alternative (= 375.82-7).
 libgles-nvidia1:amd64 depends on nvidia-alternative (= 375.82-7).
 libnvidia-ml1:i386 depends on nvidia-alternative (= 375.82-7).
 libnvidia-ml1:amd64 depends on nvidia-alternative (= 375.82-7).
 libgles1-glvnd-nvidia:i386 depends on nvidia-alternative (= 375.82-7).
 libgles1-glvnd-nvidia:amd64 depends on nvidia-alternative (= 375.82-7).
 libnvidia-cfg1:i386 depends on nvidia-alternative (= 375.82-7).
 libnvidia-cfg1:amd64 depends on nvidia-alternative (= 375.82-7).
 libgles-nvidia2:amd64 depends on nvidia-alternative (= 375.82-7).
 libgles-nvidia2:i386 depends on nvidia-alternative (= 375.82-7).
 libegl-nvidia0:i386 depends on nvidia-alternative (= 375.82-7).
 nvidia-vdpau-driver:amd64 depends on nvidia-alternative (= 375.82-7).
 nvidia-settings depends on nvidia-alternative.
 libglx-nvidia0:i386 depends on nvidia-alternative (= 375.82-7).
 libglx-nvidia0:amd64 depends on nvidia-alternative (= 375.82-7).

dpkg: error processing package nvidia-alternative (--remove):
 dependency problems - not removing
Errors were encountered while processing:
 nvidia-alternative

ls /var/lib/dpkg/状態:

root@Anonymous:~# ls /var/lib/dpkg/status*
/var/lib/dpkg/status  /var/lib/dpkg/status-old

dpkg --config-a:

root@Anonymous:~# cp /var/lib/dpkg/status-old /var/lib/dpkg/status
root@Anonymous:~# dpkg --configure -a
root@Anonymous:~# apt update
Get:1 http://ftp2.nluug.nl/os/Linux/distr/kali kali-rolling InRelease [30.5 kB]
Get:2 http://ftp2.nluug.nl/os/Linux/distr/kali kali-rolling/main Sources [11.5 MB]
Get:3 http://ftp2.nluug.nl/os/Linux/distr/kali kali-rolling/main i386 Packages [15.3 MB]                        
Get:4 http://ftp2.nluug.nl/os/Linux/distr/kali kali-rolling/main amd64 Packages [15.4 MB]                       
Fetched 42.3 MB in 13s (3,250 kB/s)                                                                             
Reading package lists... Done
Building dependency tree       
Reading state information... Done
14 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@Anonymous:~# apt upgrade -y && apt dist-upgrade -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

投稿からdpkg:エラー:現在、「i386」アーキテクチャを使用しているデータベースを削除できません。':

apt-get remove --purge `dpkg --get-selections | grep i386 | awk '{print $1}'`
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 glx-alternative-nvidia : Depends: glx-diversions (= 0.8.0)
 lib32gcc1 : Depends: libc6-i386 (>= 2.2.4) but it is not going to be installed
 lib32ncurses5 : Depends: libc6-i386 (>= 2.4) but it is not going to be installed
 lib32stdc++6 : Depends: libc6-i386 (>= 2.18) but it is not going to be installed
 lib32tinfo5 : Depends: libc6-i386 (>= 2.16) but it is not going to be installed
 lib32z1 : Depends: libc6-i386 (>= 2.4) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

ベストアンサー1

削除してください.list/etc/apt/sources.list.d/後でシステムが損傷します。

次に、次を実行します。

mv /var/lib/dpkg/info/glx-alternative-nvidia.* /tmp/
mv /var/lib/dpkg/info/nvidia-alternative.* /tmp/
dpkg --remove --force-remove-reinstreq nvidia-alternative
dpkg --remove --force-remove-reinstreq glx-alternative-nvidia
dpkg --configure -a
apt update
apt upgrade
apt dist-upgrade

おすすめ記事