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
tmuxorscreen, 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)
- 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. - 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 showedReturn-Code : Failure: 1, no end time, and the full list of packages the transaction wanted to install. - 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). - 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, thendnf upgradeagain. - Packages in a mixed state after many changes:
dnf distro-syncbrings 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.
- An interrupted install: run the same command again, for example
- Verify:
dnf checkshould print nothing.rpm -Valists 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 -rtells 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
- KVM VPS hosting: NVMe SSD and full root access, with Free Basic Managed Support.
- Unmanaged dedicated servers: full root access and free IPMI KVM, with Free Basic Managed Support.
- Linux server management: hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.
