Bug#1129339: apt hangs for 25 seconds before acting if logind isn't running
g1 <[email protected]> Sun, 01 Mar 2026 09:32:42 +0100
| Newsgroups | gmane.linux.debian.apt.devel |
|---|---|
| Message-ID | <177235396263.29154.11479267058884283358.reportbug__21831.3410574169$1772354132$gmane$org@ortica> |
Package: apt Version: 3.0.3 Severity: normal X-Debbugs-Cc: [email protected] 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 "false"; 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 "ls" or "date" to call into dbus, and maybe also contact remote servers, just to be sure... Best regards, g. [1] BTW I've been seeing "WARNING: apt does not have a stable CLI interface. Use with caution in scripts" for years, because of course why add "| less" (or "| grep something") when you have a helpful internal pager stuck in your throat? -- System Information: Debian Release: 13.3