| DNF5-HISTORY(8) | dnf5 | DNF5-HISTORY(8) |
NAME¶
dnf5-history - History Command
SYNOPSIS¶
dnf5 history <subcommand> [options] [<transaction-spec>]
DESCRIPTION¶
The history command in DNF5 allows the user to view what has happened in past transactions and offers several operations on these transactions, like undoing and redoing them. In order to use the transactions in these commands, it is assumed that they were committed while using the history_record configuration option.
For more information about <transaction-spec> see dnf5-specs(7), Patterns specification <#transaction-spec-label>.
SUBCOMMANDS¶
- list
-
List info about recorded transactions in the system. If no <transaction-spec> is specified it uses all transactions.
- info
-
Print details about specific transactions. If no <transaction-spec> is specified it uses the last transaction.
- undo
-
Revert all actions from the specified transaction. Exactly one transaction must be specified by <transaction-spec>.
- redo
-
Repeat the specified transaction. Automatically uses --ignore-extras and --ignore-installed. Unlike the rest of history commands it overrides reasons for transaction packages that are already installed. This command is useful to finish interrupted transactons. Exactly one transaction must be specified by <transaction-spec>.
- rollback
-
Undo all transactions performed after the specified transaction. Exactly one transaction must be specified by <transaction-spec>.
- store
-
Store the transaction into a directory. If no <transaction-spec> is specified it uses the last transaction.
OPTIONS FOR LIST AND INFO¶
- --reverse
-
Reverse the order of transactions in the output.
- --contains-pkgs=PACKAGE_NAME,...
-
Show only transactions containing packages with specified names. This is a list option. Globs are supported.
- --json
-
Request JSON output format for machine-readable results. Available for list and info subcommands only.
OPTIONS FOR UNDO, ROLLBACK AND REDO¶
- --skip-unavailable
-
Allow skipping packages actions that are not possible perform.
- --offline
-
Store the transaction to be performed offline. See offline command <#offline-command-ref-label>, dnf5-offline(8).
- --store=PATH
-
Store the current transaction in a directory at the specified PATH instead of running it. The stored transaction can be performed by the replay command <#replay-command-ref-label>, dnf5-replay(8). Note that repository ids in the stored transaction are mangled to @stored_transaction(repo_id) this is required because during replaying the stored repositories are recreated and they might collide with already present repositories (this doesn't apply to the special @System repository).
OPTIONS FOR UNDO AND ROLLBACK¶
- --ignore-extras
-
Don't consider extra packages pulled into the transaction as errors. They will still be reported as warnings.
- --ignore-installed
-
Don't consider mismatches between installed and stored transaction packages as errors. They will still be reported as warnings. Using this option can result in an empty transaction. For install actions skip already installed packages. For upgrade actions skip groups or environments that are not installed. For remove actions skip not installed packages/groups/environments.
EXAMPLES¶
- dnf5 history list
-
List all transactions, where the most recent transaction is printed first.
- dnf5 history info 4
-
Show detailed info about the fourth transaction.
- dnf5 history info last
-
Show detailed info about the last transaction.
- dnf5 history info last-1
-
Show detailed info about the second to last transaction.
- dnf5 history list 4..8
-
List transactions with id in 4 to 8 range.
- dnf5 history undo last
-
Undo the last transaction.
- dnf5 history undo 4 --ignore-extras
-
Undo the fourth transaction ignoring extra packages pulled into the reverting transaction.
- dnf5 history list --json
-
List all transactions in JSON format for programmatic processing.
- dnf5 history info last --json
-
Show detailed info about the last transaction in JSON format with complete package details.
JSON OUTPUT¶
- •
- dnf5 history list --json
The command returns a JSON array, each element describing one transaction. Each transaction object contains the following fields:
- id (integer) - Transaction ID.
- command_line (string) - Command line that initiated the transaction.
- start_time (integer) - Transaction start time, UNIX time.
- end_time (integer) - Transaction end time, UNIX time.
- user_id (integer) - User ID who initiated the transaction.
- status (string) - Transaction status, typically "Ok".
- releasever (string) - System release version when transaction occurred.
- altered_count (integer) - Number of packages altered in the transaction.
- •
- dnf5 history info --json
The command returns a JSON array, each element describing one transaction. Each transaction object contains the following fields:
- id (integer) - Transaction ID.
- start_time (integer) - Transaction start time, UNIX time.
- end_time (integer) - Transaction end time, UNIX time.
- rpmdb_version_begin (string) - RPM database version before the transaction.
- rpmdb_version_end (string) - RPM database version after the transaction.
- user_id (integer) - User ID who initiated the transaction.
- user_name (string) - User name and details who initiated the transaction.
- status (string) - Transaction status, typically "Ok".
- releasever (string) - System release version when transaction occurred.
- description (string) - Command line that initiated the transaction.
- comment (string) - User comment for the transaction (usually empty).
- packages (array) - List of packages altered in the transaction. Each package object contains:
- nevra (string) - Package name-epoch:version-release.architecture.
- action (string) - Action performed (Install, Remove, Upgrade, etc.).
- reason (string) - Reason for the action (User, Dependency, etc.).
- repository (string) - Repository from which the package came.
- groups (array) - List of package groups altered (only present if groups were modified).
- environments (array) - List of package environments altered (only present if environments were modified).
For empty results, both commands return [].
SEE ALSO¶
dnf5-specs(7), Patterns specification <#specs-misc-ref-label>
Author¶
See AUTHORS.md in dnf5 source distribution.
Copyright¶
Contributors to the dnf5 project.
| January 21, 2026 |