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

답변2

오직

sudo dpkg -r glx-alternative-nvidia
sudo dpkg -r nvidia-alternative

관련 정보