[From nobody Wed Mar  4 12:51:09 2026
Received: (at submit) by bugs.debian.org; 1 Mar 2026 08:32:46 +0000
X-Spam-Checker-Version: SpamAssassin 4.0.1-bugs.debian.org_2005_01_02
 (2024-03-25) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-17.9 required=4.0 tests=BAYES_00,
 BODY_INCLUDES_PACKAGE,FOURLA,FREEMAIL_FROM,HAS_PACKAGE,NO_RELAYS,
 WORD_WITHOUT_VOWELS,XMAILER_REPORTBUG autolearn=ham autolearn_force=no
 version=4.0.1-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 22; hammy, 149; neutral, 61; spammy,
 1. spammytokens:0.942-+--H*r:bugs.debian.org
 hammytokens:0.000-+--XDebbugsCc, 0.000-+--X-Debbugs-Cc,
 0.000-+--HTo:N*Debian, 0.000-+--H*Ad:N*Bug, 0.000-+--H*Ad:N*Tracking
Return-path: &lt;g1pi@libero.it&gt;
Received: via submission by buxtehude.debian.org with esmtp (Exim 4.96)
 (envelope-from &lt;g1pi@libero.it&gt;) id 1vwcEH-00DXCP-12
 for submit@bugs.debian.org; Sun, 01 Mar 2026 08:32:46 +0000
Content-Type: text/plain; charset=&quot;us-ascii&quot;
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: g1 &lt;g1pi@libero.it&gt;
To: Debian Bug Tracking System &lt;submit@bugs.debian.org&gt;
Subject: apt hangs for 25 seconds before acting if logind isn't running
Message-ID: &lt;177235396263.29154.11479267058884283358.reportbug@ortica&gt;
X-Mailer: reportbug 13.2.0
Date: Sun, 01 Mar 2026 09:32:42 +0100
Delivered-To: submit@bugs.debian.org

Package: apt
Version: 3.0.3
Severity: normal
X-Debbugs-Cc: g1pi@libero.it

Before invoking dpkg to perform the work, apt-get connects to DBUS in
order to make the seat-manager inhibit shutdowns.

If you don't have systemd-logind or elogind running (because e.g. you
were forced to install elogind as a dependency, but you disabled
it), this hangs for 25 seconds, until dbus reports timeout on
org.freedesktop.login1.

A quick and dirty workaround consists in putting 

    DPkg::Inhibit-Shutdown &quot;false&quot;;

in a file in /etc/apt/apt.conf.d.  I could not find references to that
option in apt.conf(5), and had to search in the source code
(apt-pkg/deb/dpkgpm.cc) to discover it.  Therefore I kindly ask the
developers to document it, maybe together with Binary::apt::Pager [1].

Perhaps I am an old beard, but IMHO a package manager that depends on an
external daemon (and more generally on libsystemd) for something that
could be implemented with a lock file is a terrible idea.  Sooner or
later, someone will rewrite &quot;ls&quot; or &quot;date&quot; to call into dbus, and maybe
also contact remote servers, just to be sure...

Best regards,
	g.

[1] BTW I've been seeing &quot;WARNING: apt does not have a stable CLI
interface. Use with caution in scripts&quot; for years, because of course why
add &quot;| less&quot; (or &quot;| grep something&quot;) when you have a helpful internal
pager stuck in your throat?

-- System Information:
Debian Release: 13.3
]