Bug 1297189

Summary: dnf history undo not possible if package is missing
Product: [Fedora] Fedora Reporter: František Zatloukal <fzatlouk>
Component: dnfAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: jsilhan, mluscon, packaging-team-maint, pnemade, robin.a.meade, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-01-11 13:33:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description František Zatloukal 2016-01-10 11:56:07 UTC
Description of problem:
dnf is not able to perform history undo if some package from transaction to be undone is not installed or installed in different version.

Version-Release number of selected component (if applicable):
dnf-1.1.5

How reproducible:
Always

Steps to Reproduce:
1.Do some transaction
2.Upgrade or remove a package installed by transaction in step 1
3.dnf history undo last

Actual results:
Altered package blocks undo operation

Expected results:
dnf should be able to perform incomplete undo operation.

Comment 1 Honza Silhan 2016-01-11 13:33:01 UTC
you can workaround this problem by setting `keepcache=1` in `/etc/dnf/dnf.conf`

*** This bug has been marked as a duplicate of bug 1218415 ***

Comment 2 Robin A. Meade 2020-01-31 20:14:45 UTC
It is not true that setting `keepcache=1` in `/etc/dnf/dnf.conf` is a solution to this problem.

See:

Create internal repo from packages in cache
https://bugzilla.redhat.com/show_bug.cgi?id=1397174
(my original title was: dnf history undo doesn't work even with keepcache=1)

`dnf history undo last` doesn't work after update (keepcache=True)
https://bugzilla.redhat.com/show_bug.cgi?id=1677840

The solution offered is to use the `local` plugin.

However, if you use both keepcach=1 and the local plugin, your disk space devoted to holding old packages doubles!

This problem would go away if the practice of deleting old rpms from the mirrors ceased.

But that idea was rejected:

Don't replace packages in Fedora Updates repository - keep them all
https://bugzilla.redhat.com/show_bug.cgi?id=1218415#c31

"if we kept every single rpm pushed out in the updates repos over the life of a release the mirrors would revolt and we would not be able to ship anything."

So, instead of mirrors using their disk space to keep old packages, users are expected to configure the `local` plugin and use their own disk space, so that dnf's undo and rollback functionality will work as documented.