#932752 libreadline should pre-depend on libtinfo

Package:
libreadline8
Source:
readline
Description:
GNU readline and history libraries, run-time libraries
Submitter:
Jo Drexl
Date:
2021-02-27 12:57:04 UTC
Severity:
important
#932752#5
Date:
2019-07-22 18:16:54 UTC
From:
To:
Dear Maintainer,

when upgrading a fresh install of Stretch to Buster (German
localization) and having a Gnome desktop environment, libpam0g:amd64
fails to configure due to missing locales:

Preparing to unpack .../libpam0g_1.3.1-5_amd64.deb ...
Unpacking libpam0g:amd64 (1.3.1-5) over (1.1.8-3.6) ...
Setting up libpam0g:amd64 (1.3.1-5) ...
locale: Kann LC_ALL nicht auf die Standard-Lokale einstellen: Datei oder
Verzeichnis nicht gefunden
Checking for services that may need to be restarted...awk: error while
loading shared libraries: libtinfo.so.6: cannot open shared object file:
No such file or directory
Checking init scripts...
awk: error while loading shared libraries: libtinfo.so.6: cannot open
shared object file: No such file or directory
dpkg: error processing package libpam0g:amd64 (--configure):
subprocess installed post-installation script returned error exit
status 127
Errors were encountered while processing:
libpam0g:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

This is resulting in a dependency loop with libtinfo6, that can't be
resolved by running apt-get install -f, even after regenerating the
locales by hand (which is possible).

test@debian-test:~$ sudo locale-gen
Generating locales (this might take a while)...
  de_DE.UTF-8... done
Generation complete.
test@debian-test:~$ sudo apt-get update && sudo apt-get dist-upgrade
OK:1 http://debian.mirror.lrz.de/debian buster InRelease
OK:2 http://debian.mirror.lrz.de/debian buster-updates InRelease
OK:3 http://security.debian.org/debian-security buster/updates InRelease
Paketlisten werden gelesen... Fertig
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen.... Fertig
Probieren Sie »apt --fix-broken install«, um dies zu korrigieren.
Die folgenden Pakete haben unerfüllte Abhängigkeiten:
 guile-2.2-libs : Hängt ab von: libtinfo6 (>= 6) ist aber nicht installiert
 libedit2 : Hängt ab von: libtinfo6 (>= 6) ist aber nicht installiert
 libllvm7 : Hängt ab von: libtinfo6 (>= 6) ist aber nicht installiert
 libncurses6 : Hängt ab von: libtinfo6 (= 6.1+20181013-2) ist aber nicht installiert
 libreadline7 : Hängt ab von: libtinfo6 (>= 6) ist aber nicht installiert
E: Unerfüllte Abhängigkeiten. Versuchen Sie »apt --fix-broken install« ohne Angabe eines Pakets (oder geben Sie eine Lösung an).
test@debian-test:~$ sudo apt-get install -f
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen.... Fertig
Abhängigkeiten werden korrigiert ... Fertig
Die folgenden Pakete wurden automatisch installiert und werden nicht mehr benötigt:
  guile-2.2-libs libncurses6 libpython3.7-minimal libsasl2-modules libzstd1
  mariadb-common python3.7-minimal
Verwenden Sie »sudo apt autoremove«, um sie zu entfernen.
The following additional packages will be installed:
  libtinfo6
Die folgenden NEUEN Pakete werden installiert:
  libtinfo6
0 aktualisiert, 1 neu installiert, 0 zu entfernen und 1323 nicht aktualisiert.
47 nicht vollständig installiert oder entfernt.
Es müssen noch 0 B von 325 kB an Archiven heruntergeladen werden.
Nach dieser Operation werden 534 kB Plattenplatz zusätzlich benutzt.
Möchten Sie fortfahren? [J/n]
libpam0g:amd64 (1.3.1-5) wird eingerichtet ...
Checking for services that may need to be restarted...awk: error while loading shared libraries: libtinfo.so.6: cannot open shared object file: No such file or directory
Checking init scripts...
awk: error while loading shared libraries: libtinfo.so.6: cannot open shared object file: No such file or directory
dpkg: Fehler beim Bearbeiten des Paketes libpam0g:amd64 (--configure):
 Unterprozess installiertes post-installation-Skript gab den Fehlerwert 127 zurück
Fehler traten auf beim Bearbeiten von:
 libpam0g:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

Delaying configuration won't help either:

test@debian-test:~$ sudo apt full-upgrade -o APT::Immediate-Configure=0
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen.... Fertig
Probieren Sie »apt --fix-broken install«, um dies zu korrigieren.
Die folgenden Pakete haben unerfüllte Abhängigkeiten:
 guile-2.2-libs : Hängt ab von: libtinfo6 (>= 6) ist aber nicht installiert
 libedit2 : Hängt ab von: libtinfo6 (>= 6) ist aber nicht installiert
 libllvm7 : Hängt ab von: libtinfo6 (>= 6) ist aber nicht installiert
 libncurses6 : Hängt ab von: libtinfo6 (= 6.1+20181013-2) ist aber nicht installiert
 libreadline7 : Hängt ab von: libtinfo6 (>= 6) ist aber nicht installiert
E: Unerfüllte Abhängigkeiten. Versuchen Sie »apt --fix-broken install« ohne Angabe eines Pakets (oder geben Sie eine Lösung an).

The issue can be resolved by combining apt --fix-broken install with
configuration delay:

test@debian-test:~$ sudo apt --fix-broken install -o APT::Immediate-Configure=0
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen.... Fertig
Abhängigkeiten werden korrigiert ... Fertig
Die folgenden Pakete wurden automatisch installiert und werden nicht mehr benötigt:
  guile-2.2-libs libncurses6 libpython3.7-minimal libsasl2-modules libzstd1
  mariadb-common python3.7-minimal
Verwenden Sie »sudo apt autoremove«, um sie zu entfernen.
The following additional packages will be installed:
  libtinfo6
Die folgenden NEUEN Pakete werden installiert:
  libtinfo6
0 aktualisiert, 1 neu installiert, 0 zu entfernen und 1323 nicht aktualisiert.
47 nicht vollständig installiert oder entfernt.
Es müssen noch 0 B von 325 kB an Archiven heruntergeladen werden.
Nach dieser Operation werden 534 kB Plattenplatz zusätzlich benutzt.
Möchten Sie fortfahren? [J/n]
Vormals nicht ausgewähltes Paket libtinfo6:amd64 wird gewählt.
(Lese Datenbank ... 133442 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../libtinfo6_6.1+20181013-2_amd64.deb ...
Entpacken von libtinfo6:amd64 (6.1+20181013-2) ...
readline-common (7.0-5) wird eingerichtet ...
libexpat1:amd64 (2.2.6-2) wird eingerichtet ...
libldap-common (2.4.47+dfsg-3) wird eingerichtet ...
Trigger für cracklib-runtime (2.9.2-5) werden verarbeitet ...
libelf1:amd64 (0.176-1.1) wird eingerichtet ...
mysql-common (5.8+1.0.5) wird eingerichtet ...
libxshmfence1:amd64 (1.3-1) wird eingerichtet ...
xkb-data (2.26-2) wird eingerichtet ...
libsasl2-modules-db:amd64 (2.1.27+dfsg-1) wird eingerichtet ...
libtinfo6:amd64 (6.1+20181013-2) wird eingerichtet ...
libsasl2-2:amd64 (2.1.27+dfsg-1) wird eingerichtet ...
libgc1c2:amd64 (1:7.6.4-0.4) wird eingerichtet ...
libva2:amd64 (2.4.0-1) wird eingerichtet ...
libbsd0:amd64 (0.9.1-2) wird eingerichtet ...
libdrm-common (2.4.97-1) wird eingerichtet ...
libx11-xcb1:amd64 (2:1.6.7-1) wird eingerichtet ...
p11-kit-modules:amd64 (0.23.15-2) wird eingerichtet ...
Trigger für libc-bin (2.28-10) werden verarbeitet ...
libldap-2.4-2:amd64 (2.4.47+dfsg-3) wird eingerichtet ...
libssl1.1:amd64 (1.1.1c-1) wird eingerichtet ...
libc-l10n (2.28-10) wird eingerichtet ...
libltdl7:amd64 (2.4.6-9) wird eingerichtet ...
libfribidi0:amd64 (1.0.5-3.1) wird eingerichtet ...
Trigger für man-db (2.7.6.1-2) werden verarbeitet ...
libpam0g:amd64 (1.3.1-5) wird eingerichtet ...
Checking for services that may need to be restarted...Checking init scripts...

Restarting services possibly affected by the upgrade:
  exim4: stopping...starting...done.
  cups: stopping...starting...done.
  cron: stopping...starting...done.

Services restarted successfully.

libncurses6:amd64 (6.1+20181013-2) wird eingerichtet ...
locales (2.28-10) wird eingerichtet ...
Neue Version der Konfigurationsdatei /etc/locale.alias wird installiert ...
Generating locales (this might take a while)...
  de_DE.UTF-8... done
Generation complete.
libx11-data (2:1.6.7-1) wird eingerichtet ...
libxau6:amd64 (1:1.0.8-1+b2) wird eingerichtet ...
libedit2:amd64 (3.1-20181209-1) wird eingerichtet ...
mariadb-common (1:10.3.15-1) wird eingerichtet ...
update-alternatives: /etc/mysql/mariadb.cnf wird verwendet, um /etc/mysql/my.cnf (my.cnf) im automatischen Modus bereitzustellen
libllvm7:amd64 (1:7.0.1-8) wird eingerichtet ...
libreadline7:amd64 (7.0-5) wird eingerichtet ...
libpython3.7-minimal:amd64 (3.7.3-2) wird eingerichtet ...
python3.7-minimal (3.7.3-2) wird eingerichtet ...
libdrm2:amd64 (2.4.97-1) wird eingerichtet ...
libdrm-radeon1:amd64 (2.4.97-1) wird eingerichtet ...
libdrm-nouveau2:amd64 (2.4.97-1) wird eingerichtet ...
guile-2.2-libs:amd64 (2.2.4+1-2) wird eingerichtet ...
libxcb1:amd64 (1.13.1-2) wird eingerichtet ...
libxcb-present0:amd64 (1.13.1-2) wird eingerichtet ...
libxcb-dri2-0:amd64 (1.13.1-2) wird eingerichtet ...
libxcb-dri3-0:amd64 (1.13.1-2) wird eingerichtet ...
libxcb-xfixes0:amd64 (1.13.1-2) wird eingerichtet ...
libdrm-amdgpu1:amd64 (2.4.97-1) wird eingerichtet ...
libx11-6:amd64 (2:1.6.7-1) wird eingerichtet ...
libvdpau1:amd64 (1.1.1-10) wird eingerichtet ...
libxatracker2:amd64 (18.3.6-2) wird eingerichtet ...
libxcb-sync1:amd64 (1.13.1-2) wird eingerichtet ...
mesa-va-drivers:amd64 (18.3.6-2) wird eingerichtet ...
mesa-vdpau-drivers:amd64 (18.3.6-2) wird eingerichtet ...
Trigger für libc-bin (2.28-10) werden verarbeitet ...
W: APT had planned for dpkg to do more than it reported back (143 vs 147).
   Affected packages: libpam0g:amd64

After this operation the dist-upgrade continues as expected.

FYI: This has happened on every upgrade on GUI machines I've
tried, and was reproduced on a fresh Stretch install on a DELL Latitude
E4300 PP13S

#932752#10
Date:
2019-07-22 19:18:23 UTC
From:
To:
Control: reassign -1 libpam0g
#932752#19
Date:
2019-07-23 03:38:02 UTC
From:
To:
Julian, I don't see how this can be a pam bug, and you didn't include any
explanation when you reassigned.

The failure here is due to libpam0g calling awk in its postinst, and awk not
having all of its libraries unpacked, making awk unusable.  However,
libpam0g does not depend on awk because packages are not supposed to: awk is
"virtually essential" by way of a pre-dependency from base-files to the
'awk' virtual package.  (This is not documented in debian-policy, but it has
always been understood that awk is meant to be treated as essential
functionality and that this is why base-files pre-depends on it.)

This problem only affects users who have /etc/alternatives/awk pointing to
gawk instead of mawk.  If you are using mawk (the default), it does not
require libtinfo6.  If you are using gawk, then it requires libreadline7 ->
libtinfo6, and this is a new dependency when upgrading from stretch to
buster (libtinfo5->6 transition).

So if this is a pam bug, it looks to me like a bug that can also affect many
other packages (with pam most likely to be affected, due to its own location
deep in the dependency tree).  And if it is a pam bug, I'm also not sure how
to fix it.  Should I add an explicit dependency on mawk?  But the reason awk
is "virtually essential" is to allow installations to pick a different
implementation for /usr/bin/awk, and optionally remove mawk from their
system entirely, which would no longer be possible.

Or, since gawk is an implementor of the virtually-essential awk, should its
transitive dependencies not be held to the same standard as other essential
packages, and be required to pre-depend on their shared library dependencies
instead of depending on them?

#932752#24
Date:
2021-02-01 18:00:42 UTC
From:
To:
reassign  932752 gawk
retitle 932752 gawk should pre-depend on shared libraries
thanks


Hi.  The interesting diagnosis is in the last message from Steve.
What's happening is that on a stretch->buster upgrade,  gawk is
unpacked, because it is pre-depended by an essential package
(base-files), but its dependencies are not yet unpacked and it is not
yet configured.

Pam tries to use it, which ought to be fine because as Steve points out
the awk virtual package is virtually essential through that dependency
in base-files.
Unfortunately, the shared libraries are not generally available, so it
fails.
That breaks the upgrade.

This problem can happen in future upgrades when gawk is chosen instead
of mawk.

I agree with Steve's analysis and believe that the solution is for gawk
to hold itself to the standards of an essential package, and thus
pre-depend on its shared libraries.

#932752#33
Date:
2021-02-27 12:54:15 UTC
From:
To:
Control: reassign -1 libreadline8
Control: retitle -1 libreadline should pre-depend on libtinfo
Control: affects -1 gawk libpam0g

That's what gawk is doing since hamm.

Steve said that libreadline should pre-depend on libtinfo.

cu
Adrian