#876765 apt: refuses to install packages; dependencies need to be given explicitly

Package:
apt
Source:
apt
Description:
commandline package manager
Submitter:
Vincent Lefevre
Date:
2017-09-25 16:27:04 UTC
Severity:
normal
#876765#5
Date:
2017-09-25 16:24:27 UTC
From:
To:
I want to upgrade, but "apt dist-upgrade" wants to remove lots of
packages (including the X server!). So, let's try manually, with
qtbase5-dev:

cventin:~> apt install -s qtbase5-dev
[...]
The following packages will be REMOVED:
  libegl1-glvnd-nvidia libegl1-glvnd-nvidia:i386 libegl1-mesa-dev libgtk-3-dev
[...]

It wants to remove libgtk-3-dev, which is not OK, so:

cventin:~> apt install -s qtbase5-dev libgtk-3-dev
[...]
The following packages have unmet dependencies:
 libgtk-3-dev : Depends: libgtk-3-0 (= 3.22.21-1) but it is not going to be installed
                Depends: gir1.2-gtk-3.0 (= 3.22.21-1) but it is not going to be installed
                Depends: libegl1-mesa-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

But I don't see what could be broken. Indeed, I can add the
dependencies one after the one, which can lead to the upgrade:

cventin:~> apt install -s qtbase5-dev libgtk-3-dev libegl1-mesa-dev
[...]
The following packages have unmet dependencies:
 libegl1-mesa-dev : Depends: libglvnd-dev but it is not going to be installed
 qtbase5-dev : Depends: libgl1-mesa-dev but it is not going to be installed or
                        libgl-dev
               Depends: libglu1-mesa-dev but it is not going to be installed or
                        libglu-dev
E: Unable to correct problems, you have held broken packages.

cventin:~> apt install -s qtbase5-dev libgtk-3-dev libegl1-mesa-dev libglvnd-dev
The following packages have unmet dependencies:
 libglvnd-dev : Depends: libopengl0 (= 0.2.999+git20170802-4)
E: Unable to correct problems, you have held broken packages.

cventin:~> apt install -s qtbase5-dev libgtk-3-dev libegl1-mesa-dev libglvnd-dev libopengl0
[...]
The following packages will be REMOVED:
  bijiben caribou caribou-antler empathy evolution evolution-plugin-bogofilter
  evolution-plugin-pstimport evolution-plugins gir1.2-clutter-1.0
  gir1.2-cogl-1.0 gir1.2-coglpango-1.0 gnome-getting-started-docs
  gnome-user-guide gstreamer1.0-clutter-3.0 gthumb libchamplain-0.12-0
  libchamplain-gtk-0.12-0 libcheese-gtk25 libcheese8 libclutter-1.0-0
  libclutter-gst-3.0-0 libclutter-gtk-1.0-0 libcogl-pango20 libcogl-path20
  libcogl20 libedataserverui-1.2-1 libegl1-glvnd-nvidia
  libegl1-glvnd-nvidia:i386 libevolution libgl1-glvnd-nvidia-glx
  libgl1-glvnd-nvidia-glx:i386 libgl1-mesa-glx libgl1-mesa-glx:i386
  libgles2-glvnd-nvidia libgles2-glvnd-nvidia:i386 libglx0-glvnd-nvidia
  libglx0-glvnd-nvidia:i386 libopengl0-glvnd-nvidia libtxc-dxtn-s2tc0
  libwebkit2gtk-4.0-37 libwebkit2gtk-4.0-37-gtk2 libyelp0 metacity yelp zenity
[...]

At this point, this is still not OK, because other packages are
removed. However, apt is again incorrect here, as I can force
their installation so that they are kept:

cventin:~> apt install -s qtbase5-dev libgtk-3-dev libegl1-mesa-dev libglvnd-dev libopengl0 bijiben caribou caribou-antler empathy evolution evolution-plugin-bogofilter evolution-plugin-pstimport evolution-plugins gir1.2-clutter-1.0 gir1.2-cogl-1.0 gir1.2-coglpango-1.0 gnome-getting-started-docs gnome-user-guide gstreamer1.0-clutter-3.0 gthumb metacity yelp zenity wine32:i386
[...]
The following packages will be REMOVED:
  libegl1-glvnd-nvidia libegl1-glvnd-nvidia:i386 libgl1-glvnd-nvidia-glx
  libgl1-glvnd-nvidia-glx:i386 libgl1-mesa-glx:i386 libgles2-glvnd-nvidia
  libgles2-glvnd-nvidia:i386 libglx0-glvnd-nvidia libglx0-glvnd-nvidia:i386
  libopengl0-glvnd-nvidia libtxc-dxtn-s2tc0 libwebkit2gtk-4.0-37-gtk2
[...]

Now, only libraries are removed (all of them have been installed
automatically via dependencies), which is OK.

They are actually 2 issues:

1. The fact that this wasn't found with
   "apt install -s qtbase5-dev libgtk-3-dev".

2. The fact that with "apt install -s qtbase5-dev libgtk-3-dev
   libegl1-mesa-dev libglvnd-dev libopengl0", apt wants to remove
   too much.

I've attached in an archive:
  /var/lib/dpkg/status
  /var/lib/apt/extended_states