Updated: 28 September 2026 · Applies to: dnf 4.14 to 4.20 on AlmaLinux and Rocky Linux 9 and 10 and RHEL 9 and 10 (the yum command is an alias of dnf); notes for dnf5 on Fedora

Every install, update and removal made with dnf (or yum) is recorded as a numbered transaction. The history answers questions such as "what changed before the site broke?" and can undo a transaction. On current systems yum history runs dnf history, so the commands below work with either name.

List transactions

dnf history

Each line shows the ID, the command that was run, the date, the action (Install, Upgrade, Removed and so on) and how many packages changed. Newest transactions come first.

Only the transactions that touched one package:

dnf history list httpd

See the details of a transaction

dnf history info 15

This shows who ran it, when, the exact command line and every package it installed, upgraded or removed, with versions. dnf history info without a number shows the latest transaction.

Undo, redo and roll back

  1. Undo one transaction (removes what it installed, reinstalls what it removed):
    dnf history undo 15
  2. Repeat a transaction: dnf history redo 15
  3. Return the whole system to the state after transaction 12, undoing everything since:
    dnf history rollback 12

Undoing an upgrade needs the older package versions to still be available in the repositories. If they are gone, dnf reports that it cannot find them. Always read the list dnf shows before you answer y, and be careful with rollbacks that include kernel or glibc updates.

Which packages did I install myself?

dnf history userinstalled

This lists packages installed on purpose, not as dependencies. On Fedora (dnf5) use dnf repoquery --userinstalled instead, which also works on dnf 4.

The log files

For a plain text record, read /var/log/dnf.log and /var/log/dnf.rpm.log. The second one lists every package change with its time and is easy to search with grep, for example grep -i openssl /var/log/dnf.rpm.log.

On Ubuntu and Debian

apt keeps its history in /var/log/apt/history.log (older entries in compressed files next to it). There is no built-in undo command.

See also 4 ways to list installed packages.

Official documentation: DNF command reference (history command).

Ucartz services for this topic

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