-
Bug
-
Resolution: Done-Errata
-
Normal
-
CentOS Stream 8
-
dnf-4.14.0-10.el9
-
None
-
None
-
rhel-sst-cs-software-management
-
ssg_core_services
-
10
-
12
-
None
-
Yes
-
Red Hat Enterprise Linux
-
None
-
-
Pass
-
None
-
Bug Fix
-
-
Done
-
x86_64
-
None
What were you trying to do that didn't work?
According to DNF Configuration Reference (man dnf.conf), a repository with a lowest cost should be picked when the priorities are equal.
cost integer
The relative cost of accessing this repository, defaulting to 1000. This value is compared when the priorities of two repositories are the same. The repository with the lowest cost is picked. It is useful to make the library prefer on-disk repositories to remote ones.The relative cost of accessing this repository, defaulting to 1000. This value is compared when the priorities of two repositories are the same. The repository with the lowest cost is picked. It is useful to make the library prefer on-disk repositories to remote ones.
However, DNF is picking the repository with the highest cost.
Please provide the package NVR for which bug is seen:
dnf-4.7.0-19
How reproducible:
Steps to reproduce
- Mirror a repo locally (I mirrored appstream)
- Create a local_appstream repo with a lower cost than default (1000)
[local_appstream] name=Local CentOS Stream $releasever - AppStream baseurl=file:///dnf/CentOS8/appstream/ gpgkey=file:///dnf/CentOS8/RPM-GPG-KEY-centosofficial gpgcheck=1 enabled=1 cost=900
**
- Try to install a package available in appstream/local_appstream. DNF should pick the package from local_appstream (lowest cost), but picks it from appstream.
[root@localhost ~]# dnf install wget Last metadata expiration check: 0:00:01 ago on Thu 16 Nov 2023 05:51:58 PM -03. Dependencies resolved. ============================================================================================================================================================================================================== Package Architecture Version Repository Size ============================================================================================================================================================================================================== Reinstalling: wget x86_64 1.19.5-11.el8 appstream 734 k Transaction Summary ============================================================================================================================================================================================================== Total download size: 734 k Installed size: 2.8 M Is this ok [y/N]: N Operation aborted.
- Change the cost of the local repo to a value higher than default.
[local_appstream] name=Local CentOS Stream $releasever - AppStream baseurl=file:///dnf/CentOS8/appstream/ gpgkey=file:///dnf/CentOS8/RPM-GPG-KEY-centosofficial gpgcheck=1 enabled=1 cost=1100
**
- Try to install the same package. DNF now picks the package from local_appstream.
[root@localhost ~]# dnf install wget Last metadata expiration check: 0:00:01 ago on Thu 16 Nov 2023 05:51:58 PM -03. Dependencies resolved. ============================================================================================================================================================================================================== Package Architecture Version Repository Size ============================================================================================================================================================================================================== Reinstalling: wget x86_64 1.19.5-11.el8 local_appstream 734 k Transaction Summary ============================================================================================================================================================================================================== Total download size: 734 k Installed size: 2.8 M Is this ok [y/N]: N Operation aborted.
Expected results
DNF should treat the cost option as described in man documentation, or the documentation should be updated to reflect the software behaviour.
Actual results
DNF repo cost option is working the oposite way as described in man documentation.
- is cloned by
-
RHEL-33545 DNF repo cost option is working the oposite way as described in man
- Release Pending
- links to
-
RHBA-2024:131112 dnf bug fix and enhancement update