dnf5-history - Man Page
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.
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, 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, 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
Author
See AUTHORS.md in dnf5 source distribution.
Copyright
Contributors to the dnf5 project.
Referenced By
The man page dnf-history(8) is an alias of dnf5-history(8).