[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#935910: marked as done (apt: Should be less tolerant of dpkg errors when forcing removal)



Your message dated Thu, 19 Sep 2019 10:04:02 +0000
with message-id <E1iAtIA-0008Xx-Os@fasolo.debian.org>
and subject line Bug#935910: fixed in apt 1.9.4
has caused the Debian Bug report #935910,
regarding apt: Should be less tolerant of dpkg errors when forcing removal
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
935910: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=935910
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: apt
Version: 1.8.3
Severity: important

Dear apt maintainers,

This report is a result of my investigation of #934491 which shows that when
trying to migrate a sid install from systemd to sysvinit and elogind by the most
obvious route it is possible to break the system in a way that is difficult to
recover with the fairly simple command:

 apt install libpam-elogind sysvinit-core

I think the root cause of the issue is the way apt invokes dpkg when forcing
removals which is not sufficiently responsive to errors.

In this case apt's dpkg commands are:

 echo 'libpam-systemd:amd64 deinstall' | /usr/bin/dpkg --set-selections 
 echo 'systemd-sysv:amd64 deinstall' | /usr/bin/dpkg --set-selections 
 echo 'systemd:amd64 deinstall' | /usr/bin/dpkg --set-selections 
 echo 'libsystemd0:amd64 deinstall' | /usr/bin/dpkg --set-selections 
 /usr/bin/dpkg --status-fd 18 --no-triggers --force-depends --remove libpam-systemd:amd64 
 /usr/bin/dpkg --status-fd 18 --no-triggers --unpack --auto-deconfigure /var/cache/apt/archives/libpam-elogind_241.3-1+debian1_amd64.deb 
 /usr/bin/dpkg --status-fd 18 --no-triggers --force-depends --remove systemd-sysv:amd64 
 /usr/bin/dpkg --status-fd 18 --no-triggers --unpack --auto-deconfigure /var/cache/apt/archives/sysvinit-core_2.96~beta-1_amd64.deb 
 /usr/bin/dpkg --status-fd 18 --no-triggers --force-depends --remove systemd:amd64 libsystemd0:amd64 
   ^^^ The line above causes the problem ^^^
 /usr/bin/dpkg --status-fd 18 --no-triggers --unpack --auto-deconfigure /var/cache/apt/archives/libelogind0_241.3-1+debian1_amd64.deb 
 /usr/bin/dpkg --status-fd 18 --no-triggers --configure libelogind0:amd64 
 /usr/bin/dpkg --status-fd 18 --no-triggers --unpack --auto-deconfigure /var/cache/apt/archives/elogind_241.3-1+debian1_amd64.deb 
 /usr/bin/dpkg --status-fd 18 --configure --pending 

The problem is caused by the invocation forcing the removal of systemd and
libsystemd0. If systemd is pid 1 then its prerm will fail to prevent
removal. However, dpkg still continues to remove libsystemd0 as requested
*before* exiting and signalling an error. apt then stops in response to the dpkg
error. The system is then broken as there is no libsystemd.so.0 installed which
apt itself requires.

My solution is to invoke dpkg with --abort-after=1.  The command line

 apt install -o DPkg::Options::="--abort-after=1" install libpam-elogind sysvinit-core

no longer breaks a sid systemd system. This means that dpkg exits immediately
after the systemd prerm fails and libsystemd0 remains installed. The
dependencies can then be fixed with apt.

I suggest that --abort-after=1 should be apt's default when forcing package
removal.

Thanks

Mark

--- End Message ---
--- Begin Message ---
Source: apt
Source-Version: 1.9.4

We believe that the bug you reported is fixed in the latest version of
apt, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 935910@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Julian Andres Klode <jak@debian.org> (supplier of updated apt package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Thu, 19 Sep 2019 11:13:47 +0200
Source: apt
Architecture: source
Version: 1.9.4
Distribution: experimental
Urgency: medium
Maintainer: APT Development Team <deity@lists.debian.org>
Changed-By: Julian Andres Klode <jak@debian.org>
Closes: 935910
Changes:
 apt (1.9.4) experimental; urgency=medium
 .
   * CMake: Pass -Werror=return-type to gcc
   * CMake: Produce a fatal error if triehash could not be found
   * apt.systemd.daily: Do not numerically check if intervals equal 0
     (LP: #1840995)
   * srvrec: Use re-entrant resolver functions
   * Pass --abort-after=1 to dpkg when using --force-depends (Closes: #935910)
     (LP: #1844634)
   * Fix use of GTest to adjust for GTest 1.9
Checksums-Sha1:
 1d608a809ab00b5154c4feb1e478e0ef30305d2a 2744 apt_1.9.4.dsc
 8704f131b4156528f5b7b7da65e5ce01e32bbf1e 2170120 apt_1.9.4.tar.xz
 ce259d682413dcc4c591b8979da0eb4a30a83619 7116 apt_1.9.4_source.buildinfo
Checksums-Sha256:
 fef428ea8f433254dc126558c0e708a40d26402778c2cf7429fd8203cbf75728 2744 apt_1.9.4.dsc
 85ae8d5beb44fa02ed88af32137f4c97e7a68e5d9ba4164eab515988105ba292 2170120 apt_1.9.4.tar.xz
 59d5c7630d235e051b77e12411d3a9ffa133931b11982e7e4839d8600bace268 7116 apt_1.9.4_source.buildinfo
Files:
 0f2f2085a0bd3b3f8aaeeb4e51d364a8 2744 admin important apt_1.9.4.dsc
 3a968084b92d6d9932f95947acfd3f65 2170120 admin important apt_1.9.4.tar.xz
 24bc5e05f5fec87d0c877eaf17a14743 7116 admin important apt_1.9.4_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQJDBAEBCgAtFiEET7WIqEwt3nmnTHeHb6RY3R2wP3EFAl2DS0YPHGpha0BkZWJp
YW4ub3JnAAoJEG+kWN0dsD9xOwkQAI5ewSQoE7MaseMcpmnriE68tJbWzfoBlRx5
ZCvgWmA7NGjdZCqR41oJwrQPJTrs2B2Ao3nL0BACt+sOFZ8krl7cEYY3GyPMa/Iz
Yr3ppi1nUsJYN1l9X2K4444ofW9xN5HPxzrFETO/37LDc3lkdJsWZffgAiqQGbbw
4QtdzYZA/B1xJxxgvk/ahI4OwvA6PPCF/hyFxgYVMBKXk0idxvSCM5NHlZair9D5
h2N39ywtrb6mXAcGEarLazJKb3G7JT8XJgsETqjkwCsSyg+z7gP/z/H1YzWFm22A
FOcrZUhMTrw3Anp7/VHc+3xS9TvagqMtX1i1w7QtbcaPiXIcjs7c44vP3Tg8fKyW
ftZVbLcq7sKsXIKXx3AX6rWU3O/ffWb6rwafPRspUSkpolWmw95CbxUpfcTomXq5
sNCTKUXDAn4kTP2RYg/rMioRzpqAue7Rrzkg74rSmMmIOHI8t5+pAJ+Kc+LjBN7I
nImCHv6VbiRmh16Kax27OqvCpAstJhPVZ8ljeXKai5G+nTVYFyuWF4it9EZER78m
u4CADvKt1Z4WVeae1fogucdu5QIkuOtufUf1VtkympcYBMUMZnfK8KEPjaFmN9yI
j36SMuEMeRQaVENqEdS71Y1Gj2xCQl3JuOBpbMgN9sgLXB732W6MWwXQVJoCDQzV
TuoCSndS
=qPG7
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: