Roll Back Package Changes with dnf history undo
dnf history records every install/upgrade transaction with an ID, and history undo reverses a chosen one package-by-package.
Run `sudo dnf history` to list past transactions with IDs, then `sudo dnf history undo <id>` to reverse a specific transaction.
01Command
Command
$ sudo dnf history02What it does
Every dnf action is written to a transaction history with ID, timestamp, and the acting user — `dnf history info <id>` shows exactly which packages were installed, upgraded, or erased. `dnf history undo <id>` applies the inverse operations, and `history rollback <id>` rewinds the system to the state after that transaction. This is the forgotten safety net when an update breaks something and you want package-level reversal rather than a VM rollback.
03Risk
!Warning: Undo works at the package level only — it will not revert configuration-file edits or database migrations a package performed.
04Undo
Undo
$ sudo dnf history undo <transaction-id>05Sources
- DNF Command Reference — history commandsEvidence: dnf history lists transactions, dnf history info <id> shows details, and dnf history undo <id> repeats the inverse of the specified transaction.
Last verified: 2026-09-17 · Category: System & Settings