APT and dpkg status database interoperability during aborted distribution upgrades
25K reputation · 03 Apr 2023, 16:37 UTC
During a Debian distribution upgrade, the system relies on the interaction between the APT dependency resolver and the dpkg status database located in /var/lib/dpkg/status. When an upgrade is interrupted mid-process, the system often enters a state where packages are unpacked but not yet configured.
While dpkg --configure -a and apt-get install -f are documented methods for resolving broken dependencies and completing configurations, uncertainty remains regarding the automated handling of obsolete packages from the previous release when the upgrade is aborted and the user attempts to stabilize the current state.
Specifically, it is unclear how the system prioritizes the cleanup of these legacy packages without risking the removal of critical system components required for the recovery process itself.
- Does APT automatically identify and flag obsolete packages for removal during a recovery attempt, or must they be manually purged?
- What is the expected behavior of the package manager when a recovery attempt encounters a dependency loop between a partially upgraded package and a legacy package?