Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1800342

Summary: dnf download and list do not respect repo priority
Product: [Fedora] Fedora Reporter: Laurie Reeves <laurie>
Component: dnfAssignee: Pavla Kratochvilova <pkratoch>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 31CC: jmracek, jrohel, mblaha, mhatina, packaging-team-maint, pkratoch, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-4.2.21-1.fc31 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-18 00:07:08 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 Laurie Reeves 2020-02-06 22:02:09 UTC
Description of problem:
When doing a dnf list or download command, the repository priority is not used. However, the actual install will install the package from the correct repository.

Version-Release number of selected component (if applicable):
Current versions from Fedora 31:
dnf.noarch                              4.2.18-1.fc31
dnf-plugins-core.noarch                 4.0.13-1.fc31
libdnf.x86_64                           0.43.1-1.fc31 
libmodulemd.x86_64                      2.8.3-1.fc31 
librepo.x86_64                          1.11.1-1.fc31 
libsolv.x86_64                          0.7.11-1.fc31

I also played around with experimental builds from koji, but got the same results.

How reproducible:
100%

Steps to Reproduce:
In general terms, find a package with a higher version in a repository with a lower priority (higher priority value). 'dnf list' and 'dnf download' will both provide the higher version from lower priority repository. However, 'dnf install' will correctly provide the lower versioned package from the higher priority repository.

An example:
1. Currently, Fedora 31 'updates' repository has youtube-dl version 2020.01.24, updates-testing has version 2019.09.12.1.
2. Remove youtube-dl from system if installed.
3. Edit fedora-updates-testing.repo to make 'updates-testing' priority=1 (making the repository with the lower version higher priority).
4. dnf --disablerepo=* --enablerepo=updates,updates-testing list youtube-dl
5. dnf --disablerepo=* --enablerepo=updates,updates-testing download --url youtube-dl
6. dnf --disablerepo=* --enablerepo=updates,updates-testing install youtube-dl

Actual results:
The list and download commands both provide version 2020.01.24. The install command provides version 2019.09.12.1.

Expected results:
All three commands should provide the 2019.09.12.1 version.

Additional info:

My actual use-case involves dnf download with --resolve --alldeps in an empty root to populate an install tree. This functionality is vital.

Priorities worked correctly with 'yumdownloader' on Centos 6.

Comment 1 Jaroslav Mracek 2020-02-19 09:03:37 UTC
Probably this https://github.com/rpm-software-management/dnf/pull/1554 could be helpful.

Comment 3 Fedora Update System 2020-04-02 12:50:26 UTC
FEDORA-2020-d51dbe83a9 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-d51dbe83a9

Comment 4 Fedora Update System 2020-04-03 20:49:54 UTC
FEDORA-2020-d51dbe83a9 has been pushed to the Fedora 31 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-d51dbe83a9`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-d51dbe83a9

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

Comment 5 Fedora Update System 2020-04-18 00:07:08 UTC
FEDORA-2020-d51dbe83a9 has been pushed to the Fedora 31 stable repository.
If problem still persists, please make note of it in this bug report.