在 Debian Buster 上删除 NVIDIA 后,依赖关系被破坏

在 Debian Buster 上删除 NVIDIA 后,依赖关系被破坏

我使用 Debian Buster。在我安装了 NVIDIA 并决定回到 Nouveau 后,我卸载了 NVIDIA,然后在更新和安装软件包时遇到了一些问题。

这是我尝试更新时得到的结果:

$ sudo apt-get upgrade
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).

当我安装某些东西时:

$ sudo apt-get install mtpaint
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.3)
 mtpaint : Depends: gtklp but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

运行“apt --fix-broken install”并不能解决问题

$ sudo 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:
  libegl-mesa0:i386 libegl1:i386 libgbm1:i386 libgles2:i386 libnvidia-eglcore:i386 libwayland-client0:i386 libwayland-server0:i386
  linux-image-4.12.0-2-amd64 linux-image-4.13.0-1-amd64
Use 'sudo 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/11.2 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.3); 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.8.3~); 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)

有关我的系统的一些信息:

$ uname -a
Linux hung 4.16.0-1-amd64 #1 SMP Debian 4.16.5-1 (2018-04-29) x86_64 GNU/Linux

$ cat /etc/apt/sources.list
deb http://httpredir.debian.org/debian testing main contrib non-free
deb http://httpredir.debian.org/debian testing-updates main contrib non-free
deb http://security.debian.org/ testing/updates main contrib non-free


$ ls /etc/apt/sources.list.d/
brave-buster.list                          google-chrome.list       skype-stable.list       sublime-text.list
brave-buster.list.save                     google-chrome.list.save  skype-stable.list.save  sublime-text.list.save
ethereum-ubuntu-ethereum-bionic.list       heroku.list              slack.list              yarn.list
ethereum-ubuntu-ethereum-bionic.list.save  heroku.list.save         slack.list.save         yarn.list.save

如果您对此有任何解决方案,请告诉我。谢谢!

编辑1:我无法删除损坏的包裹

$ sudo apt purge nvidia-alternative glx-alternative-nvidia
[sudo] password for hungtran:        
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:
 libgles-nvidia2 : Depends: nvidia-alternative (= 390.48-3)
 libglx-nvidia0 : Depends: nvidia-alternative (= 390.48-3)
 libnvidia-cfg1 : Depends: nvidia-alternative (= 390.48-3)
 libnvidia-egl-wayland1 : Depends: nvidia-alternative (= 390.48-3)
 libnvidia-ml1 : Depends: nvidia-alternative (= 390.48-3)
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

答案1

重新安装 glx-diversions 后,我能够删除其他软件包。

$ sudo apt-get install glx-diversions --reinstall
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libegl-mesa0:i386 libegl1:i386 libgbm1:i386 libgles2:i386 libnvidia-eglcore libnvidia-eglcore:i386 libwayland-client0:i386 libwayland-server0:i386
  linux-image-4.12.0-2-amd64 linux-image-4.13.0-1-amd64
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
5 not fully installed or removed.
Need to get 0 B/11.2 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 525146 files and directories currently installed.)
Preparing to unpack .../glx-diversions_0.8.3_amd64.deb ...
Unpacking glx-diversions (0.8.3) over (0.8.3) ...
Setting up glx-diversions (0.8.3) ...
Processing triggers for glx-alternative-mesa (0.8.3) ...
update-alternatives: updating alternative /usr/lib/mesa-diverted because link group glx has changed slave links
Setting up glx-alternative-nvidia (0.8.3) ...
Processing triggers for glx-alternative-nvidia (0.8.3) ...
Setting up nvidia-alternative (390.48-3) ...
Processing triggers for nvidia-alternative (390.48-3) ...
update-alternatives: using /usr/lib/nvidia/current to provide /usr/lib/nvidia/nvidia (nvidia) in auto mode
Setting up libnvidia-cfg1:amd64 (390.48-3) ...
Setting up libglx-nvidia0:amd64 (390.48-3) ...
Processing triggers for libc-bin (2.27-3) ...
Processing triggers for update-glx (0.8.3) ...
Processing triggers for glx-alternative-nvidia (0.8.3) ...
update-alternatives: using /usr/lib/nvidia to provide /usr/lib/glx (glx) in auto mode
Processing triggers for libc-bin (2.27-3) ...
Processing triggers for initramfs-tools (0.130) ...
update-initramfs: Generating /boot/initrd.img-4.16.0-1-amd64
W: Possible missing firmware /lib/firmware/i915/skl_dmc_ver1_27.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_dmc_ver1_04.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_guc_ver9_39.bin for module i915
W: Possible missing firmware /lib/firmware/i915/bxt_guc_ver9_29.bin for module i915
W: Possible missing firmware /lib/firmware/i915/skl_guc_ver9_33.bin for module i915

$ sudo apt-get remove nvidia-alternative
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  glx-alternative-nvidia libegl-mesa0:i386 libegl1:i386 libgbm1:i386 libgles2:i386 libnvidia-eglcore libnvidia-eglcore:i386 libnvidia-glcore
  libwayland-client0:i386 libwayland-server0:i386 linux-image-4.12.0-2-amd64 linux-image-4.13.0-1-amd64
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  libglx-nvidia0 libnvidia-cfg1 nvidia-alternative nvidia-persistenced nvidia-vulkan-icd
0 upgraded, 0 newly installed, 5 to remove and 0 not upgraded.
After this operation, 2,497 kB disk space will be freed.
Do you want to continue? [Y/n] 
(Reading database ... 525184 files and directories currently installed.)
Removing nvidia-vulkan-icd:amd64 (390.48-3) ...
Removing libglx-nvidia0:amd64 (390.48-3) ...
Removing nvidia-persistenced (390.25-1) ...
Removing libnvidia-cfg1:amd64 (390.48-3) ...
Removing nvidia-alternative (390.48-3) ...
Processing triggers for glx-alternative-nvidia (0.8.3) ...
Processing triggers for libc-bin (2.27-3) ...
Processing triggers for man-db (2.8.3-2) ...
Processing triggers for update-glx (0.8.3) ...
Processing triggers for glx-alternative-nvidia (0.8.3) ...
update-alternatives: warning: forcing reinstallation of alternative /usr/lib/nvidia because link group glx is broken
update-alternatives: warning: skip creation of /usr/lib/x86_64-linux-gnu/libnvidia-cfg.so.1 because associated file /usr/lib/x86_64-linux-gnu/nvidia/libnvidia-cfg.so.1 (of link group glx) doesn't exist
update-alternatives: warning: skip creation of /etc/modprobe.d/nvidia-blacklists-nouveau.conf because associated file /etc/nvidia/nvidia-blacklists-nouveau.conf (of link group glx) doesn't exist
update-alternatives: warning: skip creation of /etc/modules-load.d/nvidia.conf because associated file /etc/nvidia/nvidia-load.conf (of link group glx) doesn't exist
update-alternatives: warning: skip creation of /etc/modprobe.d/nvidia.conf because associated file /etc/nvidia/nvidia-modprobe.conf (of link group glx) doesn't exist
update-alternatives: using /usr/lib/mesa-diverted to provide /usr/lib/glx (glx) in auto mode
Processing triggers for libc-bin (2.27-3) ...
Processing triggers for initramfs-tools (0.130) ...
update-initramfs: Generating /boot/initrd.img-4.16.0-1-amd64
W: Possible missing firmware /lib/firmware/i915/skl_dmc_ver1_27.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_dmc_ver1_04.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_guc_ver9_39.bin for module i915
W: Possible missing firmware /lib/firmware/i915/bxt_guc_ver9_29.bin for module i915
W: Possible missing firmware /lib/firmware/i915/skl_guc_ver9_33.bin for module i915

$ sudo apt-get remove glx-alternative-nvidia
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libegl-mesa0:i386 libegl1:i386 libgbm1:i386 libgles2:i386 libnvidia-eglcore libnvidia-eglcore:i386 libnvidia-glcore libwayland-client0:i386
  libwayland-server0:i386 linux-image-4.12.0-2-amd64 linux-image-4.13.0-1-amd64
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  glx-alternative-nvidia
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 47.1 kB disk space will be freed.
Do you want to continue? [Y/n] 
(Reading database ... 525128 files and directories currently installed.)
Removing glx-alternative-nvidia (0.8.3) ...

相关内容