Question
How do I undo a yum/dnf transaction via command-line?
Answer
You may need to revert recently installed packages to the previous version. This article provides the procedure for undoing a yum/dnf transaction.
- Log in to the server via SSH or WHM's Terminal as the
rootuser. Use yum/dnf to check the update history and find the transaction ID you wish to undo.
# [root@server ~]cPs# dnf history
ID | Command line | Date and time | Action(s) | Altered
------------------------------------------------------------------------------------------------------------------------------------------------------
592 | -y --color=never --verbose shell /tmp/4pz6SmIyFe | 2025-02-20 14:01 | I, U | 106 EE 591 | --assumeyes --color=never --config /etc/yum.conf update --enablerepo=powertools --enablerepo=ep | 2025-02-20 00:13 | Upgrade | 1Note: In the above example, the transaction ID is 592.
Use the
history undocommand to revert the changes made during the specified transaction.# dnf history undo ID
Note: You must replace ID with the transaction ID from step 2.
Comments
0 comments
Article is closed for comments.