Revert DNF transactions
To undo operations performed during DNF transactions on Red Hat Enterprise Linux (RHEL) 10, revert these transactions by using the DNF tool.
By reverting transactions, you can quickly restore your system to a previous state. For example, if you installed several packages by using the dnf install command, you can uninstall these packages at once by reverting the installation transaction.
You can revert DNF transactions the following ways:
- Revert a single DNF transaction by using the
dnf history undocommand. - Revert all DNF transactions performed between the specified transaction and the last transaction by using the
dnf history rollbackcommand.
dnf history undo and dnf history rollback command is not supported. This concerns especially the selinux, selinux-policy-*, kernel, and glibc packages, and dependencies of glibc such as gcc. Therefore, downgrading a system to a minor version (for example, from RHEL 10.1 to RHEL 10.0) is not recommended because it might leave the system in an incorrect state.Revert a single DNF transaction Copy linkLink copied!
To undo operations performed during a single DNF transaction on Red Hat Enterprise Linux (RHEL) 10, revert this transaction by using the DNF tool.
About this task Copy linkLink copied!
By reverting the environment to a specific point in your package management history, you can recover from accidental changes and errors. Reverting a single transaction in DNF history will not undo or modify more recent transactions.
You can revert the transaction’s steps by using the dnf history undo command:
- If the transaction installed a new package,
dnf history undouninstalls the package. - If the transaction uninstalled a package,
dnf history undoreinstalls the package. - The
dnf history undocommand also attempts to downgrade all updated packages to their previous versions if the older packages are still available.Note If an older package version is not available, the downgrade by using thednf history undocommand fails.
Procedure Copy linkLink copied!
Revert multiple DNF transactions Copy linkLink copied!
To undo operations performed during DNF transactions on Red Hat Enterprise Linux (RHEL) 10, revert these transactions by using the DNF tool. By reverting the environment to a specific point in your package management history, you can recover from accidental changes and errors.
About this task Copy linkLink copied!
You can revert all DNF transactions performed between a specified transaction and the last transaction by using the dnf history rollback command. Note that the transaction specified by the transaction ID remains unchanged.