Bug 2226661 - Dnf5 doesn't support rollback of transaction history
Summary: Dnf5 doesn't support rollback of transaction history
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf5
Version: 39
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: rpm-software-management
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-26 06:39 UTC by Martin Osvald 🛹
Modified: 2023-08-16 08:13 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github rpm-software-management dnf5 issues 140 0 None open Implement history command 2023-07-31 11:12:34 UTC

Description Martin Osvald 🛹 2023-07-26 06:39:03 UTC
If you want to undo e.g. the last transaction `dnf history` doesn't support that.

Reproducible: Always

Steps to Reproduce:
# dnf history undo last

or

# dnf history undo XXX 
Actual Results:  
~~~
# dnf history undo last
Unknown argument "undo" for command "history". Add "--help" for more information about the arguments.
#
~~~

or 

~~~
# dnf history list
ID Command line                                           Date and time                 Action(s) Altered
 5 dnf update -y                                          2023-07-26 04:38:05.000000000               346
 4 dnf install rpmdevtools -y                             2023-07-25 11:56:16.000000000                 6
 3 dnf install rpm-build -y                               2023-07-25 11:31:30.000000000                26
 2 dnf builddep rpmbuild/SPECS/rpm.spec --enablerepo=* -y 2023-07-25 11:27:42.000000000               328
 1 dnf install dnf5-plugins -y                            2023-07-25 11:25:51.000000000                21
#

# dnf history undo 5
Unknown argument "undo" for command "history". Add "--help" for more information about the arguments.
#
~~~

Expected Results:  
It should be supported like it is with dnf4:

~~~
# dnf hist list
ID     | Command line                                 | Date and time    | Action(s)      | Altered
---------------------------------------------------------------------------------------------------
    11 | install mc -y                                | 2023-07-26 02:34 | Install        |    2
...

# dnf hist undo 11
Last metadata expiration check: 0:11:19 ago on Wed 26 Jul 2023 02:25:24 AM EDT.
Dependencies resolved.
===================================================================================================
 Package            Architecture        Version                        Repository             Size
===================================================================================================
Removing:
 mc                 x86_64              1:4.8.29-1.fc38                @updates              7.1 M
Removing dependent packages:
 slang              x86_64              2.3.3-3.fc38                   @fedora               1.6 M

Transaction Summary
===================================================================================================
Remove  2 Packages

Freed space: 8.6 M
Is this ok [y/N]:
~~~

Note: This functionality is often used by customers on RHELs.

Comment 1 Nicola Sella 2023-07-31 10:58:15 UTC
This is tracked upstream: https://github.com/rpm-software-management/dnf5/issues/140

Comment 2 Fedora Release Engineering 2023-08-16 08:13:37 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.


Note You need to log in before you can comment on or make changes to this bug.