2

I use Debian Buster. After I installed NVIDIA and decided to go back to Nouveau, I uninstalled NVIDIA and then get some problems in update and install packages.

Here is what I get when I try to update:

$ 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).

When I install something:

$ 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).

Running "apt --fix-broken install" doesn't solve the problem

$ 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)

Some info about my system:

$ 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

If you have any solutions for this please let me know. Thanks!

Edit 1: I can't remove the broken packages

$ 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).
  • suggestion: revert to the previous working state by reinstalling the removed package(s) perhaps using -f option. then install nouveau packages. since everything is using libglvnd* that shoudn't be a problem. only then remove nvidia packages. also having external repositories might add subtle dependency breakages even for this – A.B May 15 '18 at 8:59
  • @A.B I already tried to install all of them but still got the error and I was asked to run apt --fix-broken install first. – Hung Tran May 15 '18 at 9:17
  • --fix-broken is not limited to providing nothing. you can "specify a solution" by adding packages in the same command – A.B May 15 '18 at 9:32
  • @A.B Adding package names also lead to the same error. – Hung Tran May 15 '18 at 9:37
3

After reinstalling glx-diversions, I was able to remove other packages.

$ 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) ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.