[Bug 2167771] Re: unattended-upgrades hangs during shutdown, repeatedly receives SIGTERM, and leaves dpkg in an interrupted state with hundreds of unconfigured packages

code394 2167771 at bugs.launchpad.net
Wed Sep 23 15:49:38 UTC 2026


A related upstream bug may explain why this system could not recover on its own
afterwards: Unattended-Upgrade::AutoFixInterruptedDpkg has been unreachable since
2018. run() calls apt_pkg.pkgsystem_lock() before the auto-fix block, and apt's
debSystem::Lock() fails with "dpkg was interrupted" whenever the journal is
dirty, so u-u logs "Lock could not be acquired" and exits on every later run
instead of running dpkg --configure -a. Reported upstream with a patch:
https://github.com/mvo5/unattended-upgrades/issues/413


** Bug watch added: github.com/mvo5/unattended-upgrades/issues #413
   https://github.com/mvo5/unattended-upgrades/issues/413

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to unattended-upgrades in Ubuntu.
https://bugs.launchpad.net/bugs/2167771

Title:
  unattended-upgrades hangs during shutdown, repeatedly receives
  SIGTERM, and leaves dpkg in an interrupted state with hundreds of
  unconfigured packages

Status in unattended-upgrades package in Ubuntu:
  Incomplete

Bug description:
  Title:
  unattended-upgrades hangs during shutdown, repeatedly receives SIGTERM, and leaves dpkg in an interrupted state with hundreds of unconfigured packages

  Description:

  Ubuntu/Kubuntu 26.04.1 LTS hangs during shutdown when unattended-
  upgrades is active.

  Instead of completing the package transaction cleanly or aborting it
  at a safe point, the shutdown process remains stuck on:

  "Unattended-upgrade in progress during shutdown, please don't turn off
  the computer"

  During the affected shutdown, unattended-upgrades repeatedly logged:

  WARNING SIGTERM received, will stop

  approximately every 3 seconds for several minutes.

  After rebooting, dpkg was left in an interrupted state with a very
  large number of packages unpacked but not configured.

  This included critical system components such as:

  - systemd
  - grub
  - Linux kernel packages
  - NVIDIA 580 driver packages
  - libc
  - PipeWire
  - AppArmor
  - udev
  - LibreOffice
  - Python
  - OpenSSL
  - fwupd
  - many other system libraries

  One package, libinput-bin, was explicitly reported by dpkg as
  requiring reinstallation.

  This should not happen as a result of requesting a normal system
  shutdown.

  System information:

  Distributor ID: Ubuntu
  Description:    Ubuntu 26.04.1 LTS
  Release:        26.04
  Codename:       resolute

  unattended-upgrades:
    Installed: 2.12ubuntu9
    Candidate: 2.12ubuntu9

  apt:
    Installed: 3.2.0
    Candidate: 3.2.0

  unattended-upgrades.service:

  [Unit]
  Description=Unattended Upgrades Shutdown
  After=network.target local-fs.target systemd-logind.service
  RequiresMountsFor=/run /var/log /var/run /var/lib /boot
  Documentation=man:unattended-upgrade(8)

  [Service]
  ExecStart=/usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
  KillMode=process
  TimeoutStopSec=1800

  [Install]
  WantedBy=multi-user.target

  apt-daily-upgrade.service:

  [Unit]
  Description=Daily apt upgrade and clean activities
  Documentation=man:apt(8)
  ConditionACPower=true
  After=apt-daily.service network.target network-online.target systemd-networkd.service NetworkManager.service connman.service

  [Service]
  Type=oneshot
  ExecStartPre=-/usr/lib/apt/apt-helper wait-online
  ExecStart=/usr/lib/apt/apt.systemd.daily install
  KillMode=process
  TimeoutStopSec=900

  Timeline:

  2026-09-19 18:27 CEST
  apt-daily-upgrade.timer had run.

  Around 18:37-18:40 CEST
  A normal shutdown was requested.

  The machine displayed:

  "Unattended-upgrade in progress during shutdown, please don't turn off
  the computer"

  The shutdown did not complete.

  During this period /var/log/unattended-upgrades/unattended-
  upgrades.log repeatedly contained:

  WARNING SIGTERM received, will stop

  The warning was repeated approximately every 3 seconds for several
  minutes.

  Examples:

  2026-09-19 18:37:56 WARNING SIGTERM received, will stop
  2026-09-19 18:37:59 WARNING SIGTERM received, will stop
  2026-09-19 18:38:02 WARNING SIGTERM received, will stop
  2026-09-19 18:38:05 WARNING SIGTERM received, will stop
  ...
  2026-09-19 18:40:23 WARNING SIGTERM received, will stop

  The dpkg log shows a large package transaction in progress, including
  LibreOffice packages.

  Examples:

  2026-09-19 18:42:44 upgrade libreoffice-draw:amd64
  2026-09-19 18:42:45 upgrade libreoffice-writer:amd64
  2026-09-19 18:42:46 upgrade libreoffice-base-core:amd64
  2026-09-19 18:42:46 upgrade ure:amd64
  2026-09-19 18:42:46 upgrade libuno-cppuhelpergcc3-3t64:amd64
  2026-09-19 18:42:46 upgrade uno-libs-private:amd64
  2026-09-19 18:42:46 upgrade libreoffice-math:amd64
  2026-09-19 18:42:47 upgrade libreoffice-common:all
  2026-09-19 18:42:48 upgrade python3-uno:amd64
  2026-09-19 18:42:49 upgrade libuno-cppu3t64:amd64
  2026-09-19 18:42:49 upgrade libreoffice-kf6:amd64
  2026-09-19 18:42:49 upgrade libreoffice-qt6:amd64
  2026-09-19 18:42:49 upgrade libuno-sal3t64:amd64

  Several packages reached states such as:

  status half-configured
  status half-installed
  status unpacked

  The transaction did not complete normally before the shutdown/reboot.

  State after reboot:

  Running:

  sudo dpkg --audit

  reported one package requiring reinstallation:

  libinput-bin
      input device management and event handling library - udev

  It also reported a very large number of packages as unpacked but not
  configured.

  Examples included:

  accountsservice
  apparmor
  bluez
  curl
  firefox
  fwupd
  google-chrome-stable
  grub-common
  grub-pc
  grub-pc-bin
  grub2-common
  libc6
  libc6-dev
  libnvidia-cfg1-580
  libnvidia-common-580
  libnvidia-compute-580
  libnvidia-decode-580
  libnvidia-encode-580
  libnvidia-gl-580
  libnvidia-fbc1-580
  libnvidia-extra-580
  libpython3.14
  libreoffice-base-core
  libreoffice-calc
  libreoffice-core
  libreoffice-draw
  libreoffice-impress
  libreoffice-kf6
  libreoffice-math
  libreoffice-qt6
  libreoffice-writer
  linux-image-7.0.0-31-generic
  linux-modules-7.0.0-31-generic
  linux-modules-nvidia-580-open-7.0.0-31-generic
  nvidia-dkms-580-open
  nvidia-driver-580-open
  nvidia-utils-580
  openssl
  pipewire
  polkitd
  python3.14
  systemd
  systemd-coredump
  systemd-resolved
  systemd-sysv
  udev
  udisks2
  ubuntu-minimal
  ubuntu-standard
  and many others

  There were also pending triggers for:

  dbus
  desktop-file-utils
  fontconfig
  hicolor-icon-theme
  initramfs-tools
  libc-bin
  libreoffice-common
  man-db
  plymouth
  procps
  shared-mime-info
  and others

  apt-get check result immediately after the incident:

  E: dpkg was interrupted, you must manually run 'sudo dpkg --configure
  -a' to correct the problem.

  Manual recovery required:

  sudo dpkg --configure -a

  After that, dpkg --audit still reported:

  libinput-bin

  as requiring reinstallation.

  I then had to manually run:

  sudo apt install --reinstall libinput-bin

  This reinstalled/upgraded:

  libinput-bin 1.31.1-1ubuntu1.2
  libinput10    1.31.1-1ubuntu1.2

  After manual recovery:

  sudo dpkg --audit

  returned no errors.

  And:

  sudo apt-get check

  completed successfully.

  Therefore the package database is now repaired, but only after manual
  intervention.

  Expected behavior:

  If shutdown is requested while unattended-upgrades / apt / dpkg is
  performing a package transaction, the system should protect the
  integrity of the package database.

  It should either:

  1. wait for the current dpkg transaction to finish safely,

  or

  2. stop unattended-upgrades only at a safe transaction boundary and
  then complete shutdown.

  A normal shutdown request must not leave hundreds of packages
  unpacked, half-installed, half-configured, or pending configuration.

  Actual behavior:

  Shutdown hung for several minutes.

  unattended-upgrades repeatedly received SIGTERM approximately every 3
  seconds.

  The package transaction was left incomplete.

  After reboot, dpkg required manual recovery.

  A critical input-related package (libinput-bin) was left in a state
  requiring explicit reinstallation.

  The machine contained a large set of unconfigured packages, including
  systemd, grub, kernel and NVIDIA driver packages.

  Why this is serious:

  This is more than a cosmetic shutdown delay.

  Interrupting a package transaction in this way can leave critical boot
  and system packages in an inconsistent state.

  In this case the interrupted transaction included:

  - Linux kernel packages
  - initramfs-related triggers
  - GRUB
  - systemd
  - udev
  - NVIDIA kernel/driver packages

  A less experienced user could easily end up with a system that fails
  to boot or requires recovery-mode/chroot repair.

  A normal GUI shutdown should not be capable of leaving dpkg in this
  state.

  Possible area to investigate:

  There may be a race or shutdown-handling problem involving:

  /usr/share/unattended-upgrades/unattended-upgrade-shutdown

  and/or:

  apt-daily-upgrade.service

  Both services use:

  KillMode=process

  and have long shutdown timeouts:

  unattended-upgrades.service:
  TimeoutStopSec=1800

  apt-daily-upgrade.service:
  TimeoutStopSec=900

  The repeated "SIGTERM received, will stop" messages suggest that the
  upgrade process receives termination requests during shutdown but does
  not transition to a clean/safe termination state.

  It may be worth checking whether the parent unattended-upgrade process
  is terminated while dpkg or package-maintainer child processes
  continue running, or whether shutdown signals are being resent while a
  dpkg transaction is still inside an unsafe state.

  I am not claiming this is definitely the root cause, but this appears
  to be the relevant code path.

  Reproduction scenario:

  1. Allow apt-daily-upgrade / unattended-upgrades to start a sufficiently large package upgrade.
  2. While packages are being unpacked/configured, request a normal system shutdown from the desktop environment.
  3. Observe the shutdown screen.
  4. In my case the system displayed:

     "Unattended-upgrade in progress during shutdown, please don't turn
  off the computer"

  5. The machine remained in this state for several minutes.
  6. unattended-upgrades repeatedly logged SIGTERM messages.
  7. After reboot, run:

     sudo dpkg --audit
     sudo apt-get check

  8. Observe that dpkg was left interrupted and a large number of
  packages were unpacked but not configured.

  I can provide the complete unattended-upgrades log, dpkg log and apt
  history from the affected transaction if required.

  Please let me know which additional diagnostics would be useful.

  ProblemType: Bug
  DistroRelease: Ubuntu 26.04
  Package: unattended-upgrades 2.12ubuntu9
  ProcVersionSignature: Ubuntu 7.0.0-31.31-generic 7.0.14
  Uname: Linux 7.0.0-31-generic x86_64
  .var.log.unattended-upgrades.unattended-upgrades.log:
   
  ApportVersion: 2.34.1-0ubuntu0.1
  Architecture: amd64
  CasperMD5CheckResult: unknown
  CurrentDesktop: KDE
  Date: Sat Sep 19 19:07:12 2026
  InstallationDate: Installed on 2024-03-16 (917 days ago)
  InstallationMedia: Kubuntu 23.10 "Mantic Minotaur" - Release amd64 (20231010)
  PackageArchitecture: all
  SourcePackage: unattended-upgrades
  UpgradeStatus: Upgraded to resolute on 2026-05-18 (124 days ago)
  modified.conffile..etc.apt.apt.conf.d.10periodic:
   APT::Periodic::Update-Package-Lists "1";
   APT::Periodic::Download-Upgradeable-Packages "1";
   APT::Periodic::AutocleanInterval "0";
   APT::Periodic::Unattended-Upgrade "1";
  mtime.conffile..etc.apt.apt.conf.d.10periodic: 2026-06-25T03:18:28.764257

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/2167771/+subscriptions




More information about the foundations-bugs mailing list