Bug 2209408

Summary: Prepare for DNF 5, don't depend on `dnf`
Product: [Fedora] Fedora Reporter: Evan Goode <egoode>
Component: rpmdistro-repoqueryAssignee: Michel Lind <michel>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: 40CC: michel
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: rpmdistro-repoquery-0^20250110git2dd8134-3.fc41 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-01-12 01:39:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2166026    

Description Evan Goode 2023-05-23 19:33:46 UTC
(I'm filing issues with all the packages that currently depend on `dnf`.)

DNF 5 is a new package manager that will replace DNF 4 in Fedora 39+:  Starting in Fedora 39, the `dnf` command will be provided by the `dnf5` package rather than the `dnf` package, and `dnf5` will obsolete `dnf`. Since rpmdistro-repoquery currently depends on DNF 4, it should choose one of the following strategies to avoid breaking the Fedora upgrade:

- Add support for DNF 5, and depend on the `dnf5` package in Fedora 39+ instead of `dnf`. Builds of DNF 5 are available in this COPR repository: https://copr.fedorainfracloud.org/coprs/rpmsoftwaremanagement/dnf5-unstable/, and documentation is available here: https://dnf5.readthedocs.io/en/latest/.
- Alternatively, or in the meantime, change the rpmdistro-repoquery package to depend on `python3-dnf` instead of `dnf`, and call the `dnf-3` binary instead of `dnf`. The old DNF 4 command will still be available in the distribution, but only as `dnf-3` (the binary is called `dnf-3`  rather than `dnf4` for historical reasons; it is the "Python 3 version" of DNF). The first option is preferred to this one; it is not recommended to modify installed software using both DNF 4 and DNF 5 on the same system.
- Or, if this package is no longer being maintained, consider removing it from Fedora.

At some point, this project should adopt DNF 5, but the immediate issue is removing the dependency on `dnf`. We are planning to replace DNF with DNF5 in Fedora Rawhide very soon, by 2023-06-01, and the rpmdistro-repoquery package will break as long as it still depends on the `dnf` package.

For more information about the switch to DNF 5, see https://fedoraproject.org/wiki/Changes/ReplaceDnfWithDnf5.


Reproducible: Always

Comment 1 Michel Lind 2023-06-15 15:06:55 UTC
Thanks for the heads up! rpmdistro-repoquery is only used for querying, not installing packages, but I will test in a container if it can use dnf5 or not.

Comment 2 Michel Lind 2023-06-15 15:14:55 UTC
Confirmed that rpmdistro-repoquery works just fine when I edited it to use dnf5 instead of dnf on Fedora 38

Comment 3 Evan Goode 2024-02-08 23:15:15 UTC
I think this is still a valid issue since rpmdistro-repoquery still depends on dnf in all versions of Fedora: https://src.fedoraproject.org/rpms/rpmdistro-repoquery/blob/rawhide/f/rpmdistro-repoquery.spec#_17

The DNF 4 -> DNF 5 transition was delayed until Fedora 41, but now the Fedora 41 development cycle is beginning, and we are planning to obsolete DNF 4 by DNF 5 in Fedora Rawhide within the next few weeks. Again, libdnf is not going away, and the old DNF 4 command will still be available as `/usr/bin/dnf-3`, but `/usr/bin/dnf` will be DNF 5, which has a slightly different command-line interface. Packages should no longer depend on the `dnf` package in Fedora 41+.

Comment 4 Evan Goode 2024-02-08 23:19:36 UTC
I just opened https://src.fedoraproject.org/rpms/rpmdistro-repoquery/pull-request/1.

Comment 5 Aoife Moloney 2024-02-15 22:56:40 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 40 development cycle.
Changing version to 40.

Comment 6 Fedora Update System 2025-01-10 19:29:37 UTC
FEDORA-2025-49095bd00f (rpmdistro-repoquery-0^20250110git2dd8134-3.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-49095bd00f

Comment 7 Fedora Update System 2025-01-11 02:09:43 UTC
FEDORA-2025-49095bd00f has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-49095bd00f`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-49095bd00f

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2025-01-12 01:39:51 UTC
FEDORA-2025-49095bd00f (rpmdistro-repoquery-0^20250110git2dd8134-3.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.