-
Bug
-
Resolution: Unresolved
-
Normal
-
rhel-10.0.beta
-
dnf-4.20.0-1.el10
-
None
-
None
-
sst_cs_software_management
-
ssg_core_services
-
18
-
20
-
None
-
Dev ack
-
False
-
No
-
Red Hat Enterprise Linux
-
None
-
-
Pass
-
None
-
Release Note Not Required
-
-
Proposed
-
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.
- clones
-
RHEL-25005 DNF repo cost option is working the oposite way as described in man
- Closed
- links to
-
RHBA-2024:132912 DNF stack bug fix and enhancement update