Updated: 28 September 2026 · Applies to: dnf 4 on AlmaLinux and Rocky Linux 9 and 10 and RHEL 9 and 10; apt and dpkg on Ubuntu 24.04 and 26.04 and Debian 13

If a package installation or update stops half-way, because the SSH session dropped, the server lost power or someone pressed Ctrl+C at the wrong moment, some packages are installed and others are not. yum on CentOS had yum-complete-transaction for this; dnf and apt handle it differently. We interrupted a real dnf transaction on AlmaLinux 10 (killed after 3 of 14 packages) and recovered it with the steps below.

Before you start

  • Run long updates inside tmux or screen, so a dropped SSH connection does not stop them.
  • Read every transaction summary before you answer "y", especially the list of packages to be removed.
  • Have a backup or snapshot before larger repairs.

AlmaLinux, Rocky Linux and RHEL (dnf)

  1. Make sure no other dnf is still running: pgrep -a dnf. If dnf says "Waiting for process with pid ... to finish", check that the process really exists before doing anything else.
  2. Find the interrupted transaction:
    dnf history list | head
    A # or * in the last column marks a transaction that failed or did not finish. Show its details:
    dnf history info 25
    In our test it showed Return-Code : Failure: 1, no end time, and the full list of packages the transaction wanted to install.
  3. Check the package database for problems:
    dnf check
    It reports missing dependencies and duplicate packages (two versions of the same package, which happens when an update stops between installing the new and removing the old version).
  4. Repair, depending on what you find:
    • An interrupted install: run the same command again, for example dnf install texinfo. dnf installs what is missing.
    • An interrupted update with duplicates: run dnf remove --duplicates, which removes the older copies, then dnf upgrade again.
    • Packages in a mixed state after many changes: dnf distro-sync brings every package to the version in the enabled repositories.
    • To take back the whole transaction instead: dnf history undo 25. Check the list of packages it will remove very carefully.
  5. Verify: dnf check should print nothing. rpm -Va lists files that differ from their packages (changed configuration files are normal). Reboot if the kernel, glibc or systemd were part of the update; dnf needs-restarting -r tells you.

Ubuntu and Debian (apt)

dpkg --configure -a
apt --fix-broken install
apt upgrade

dpkg --configure -a finishes configuring packages that were unpacked but not set up; apt tells you to run it after an interruption ("dpkg was interrupted"). apt --fix-broken install installs or removes what is needed to satisfy dependencies. If apt reports a lock, check with pgrep -a 'apt|dpkg' that no update is still running (unattended-upgrades may be) before you continue.

Official documentation: dnf command reference and dpkg manual.

Ucartz services for this topic

Was this answer helpful? 0 Users Found This Useful (0 Votes)