Update for APT: Install, Rollback, Redo Debian Packages
APT 3.2 makes package operations undoable in Debian for the first time and resolves dependencies more stably. What the new history commands can do.
(Image: heise medien)
With APT 3.2.0, the stable release of the 3.2 development line appears, bundling the history functions already introduced in the 3.1 pre-releases and the changes to the dependency solver developed there. Admins can thus trace and undo package operations more precisely, while complex upgrades are intended to run more stably.
APT (Advanced Package Tool) manages software packages under Debian and distributions based on it, such as Ubuntu. It installs, updates, and removes software, relying on dpkg and the .deb package format.
Transaction History: Trace Package Changes
Among the most striking features of the 3.2 series is the history for structured package transactions, already created in 3.1.6 and 3.1.7. Previously, changes could only be reconstructed via log files such as /var/log/apt/history.log. Now, dedicated commands are available for this: apt history-list shows past transactions, apt history-info provides details about a specific action. apt history-undo and apt history-redo undo or repeat changes, apt history-rollback resets the package state to a previous point in time.
For example: An upgrade installs incompatible package versions. The admin identifies the affected transaction via apt history-list, checks the details with apt history-info, and undoes the change with apt history-undo. Unlike snapshot-based approaches like Btrfs or ZFS, the function operates exclusively at the package level – it does not capture configuration files or other system states. The functions were created in the pre-release versions 3.1.6 and 3.1.7 and are part of the 3.2 series with 3.2.0.
Revised Dependency Solver
The second major area concerns the dependency solver. It calculates which package combinations fit together during installation or upgrade. With the update, APT bundles several works on the solver, including changes to backtracking – i.e., the ability to systematically check alternative paths when dependencies lead to dead ends. The behavior with virtual packages (Provides) has also been adjusted: if multiple packages offer the same dependency, the solver can in some cases choose different combinations than before.
This is particularly relevant for extensive dist-upgrades and setups with external repositories, where many package sources or complex dependencies converge.
Videos by heise
Other Changes
In addition, APT includes the function "Upgrade by source package" mentioned in the changelog – relevant primarily for developers and automated build processes. Internal optimizations in dependency resolution are also included.
Technical details about the update can be found in the project's changelog.
(fo)