Bug 1984207

Summary: dnf history undo
Product: [Fedora] Fedora Reporter: Brent R Brian <brentrbrian>
Component: dnfAssignee: rpm-software-management
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 34CC: dmach, jmracek, jrohel, mblaha, mhatina, packaging-team-maint, pkratoch, rpm-software-management, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-21 06:03:15 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 Brent R Brian 2021-07-21 00:12:42 UTC
$ sudo dnf history undo 344
Last metadata expiration check: 0:44:13 ago on Tue 20 Jul 2021 07:12:57 PM EDT.
Error: The following problems occurred while running a transaction:
  Cannot find rpm nevra "gnucash-4.6-1.fc34.x86_64".
  Cannot find rpm nevra "mesa-dri-drivers-21.1.4-1.fc34.x86_64".
  Cannot find rpm nevra "mesa-filesystem-21.1.4-1.fc34.x86_64".
  Cannot find rpm nevra "mesa-libEGL-21.1.4-1.fc34.x86_64".
  Cannot find rpm nevra "mesa-libGL-21.1.4-1.fc34.x86_64".
  Cannot find rpm nevra "mesa-libGL-devel-21.1.4-1.fc34.x86_64".
  Cannot find rpm nevra "mesa-libOSMesa-21.1.4-1.fc34.x86_64".
  Cannot find rpm nevra "mesa-libgbm-21.1.4-1.fc34.x86_64".
  Cannot find rpm nevra "mesa-libglapi-21.1.4-1.fc34.x86_64".
  Cannot find rpm nevra "mesa-libxatracker-21.1.4-1.fc34.x86_64".
  Cannot find rpm nevra "mesa-vulkan-drivers-21.1.4-1.fc34.x86_64".

Several times I have tried to remove BAD UPDATES with no success.

Comment 1 Marek Blaha 2021-07-21 06:03:15 UTC
This is usually due to the fact that Fedora Updates repository only contains the latest versions of released updates. Consider following transactions:

1. install gnucash-0:4.4-1.fc34.x86_64 from Fedora repo
2. update to gnucash-0:4.6-1.fc34.x86_64 from Fedora Updates
3. update to gnucash-0:4.6-2.fc34.x86_64 from Fedora Updates

Now if you wanted to undo the transaction #3 it would mean downgrading the gnucash package to version 4.6-1. But this package is no longer present in repositories (because it was replaced by newer 4.6.-2 update), thus the error message - Cannot find rpm nevra "gnucash-4.6-1.fc34.x86_64".

You can kind of workaround it by using `local` plugin (dnf install dnf-plugin-local) which will automatically maintain a repository on the local filesystem containing all the packages dnf ever downloaded (also updates no longer present in official repositories). See https://dnf-plugins-core.readthedocs.io/en/latest/local.html for the documentation.

The other possibility is to find older build of the package in koji (e.g. https://koji.fedoraproject.org/koji/buildinfo?buildID=1776354 for gnucash) and download and install it manually.

But from dnf perspective this is not a bug - we cannot install package that is not available. Please do not hesitate to re-open the bug if the cause was different in your case.