Bug 1800342 - dnf download and list do not respect repo priority
Summary: dnf download and list do not respect repo priority
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 31
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Pavla Kratochvilova
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2020-02-06 22:02 UTC by Laurie Reeves
Modified: 2020-04-18 00:07 UTC (History)
8 users (show)

Fixed In Version: dnf-4.2.21-1.fc31
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2020-04-18 00:07:08 UTC
Type: Bug

Attachments (Terms of Use)

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:

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.

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