Bug 2394918 - dnf5 does not set releasever_minor variable from system-release(releasever_minor) RPM provide
Summary: dnf5 does not set releasever_minor variable from system-release(releasever_mi...
Keywords:
Status: POST
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: dnf5
Version: epel10
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Jonathan Wright
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-09-12 23:51 UTC by nucleo
Modified: 2025-10-24 11:09 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github rpm-software-management dnf5 issues 2400 0 None open Override releasever_{major,minor} with system-release provides 2025-09-16 07:58:31 UTC

Description nucleo 2025-09-12 23:51:16 UTC
Description of problem:
dnf5 installs packages from epel 10.1 instead of 10.0

Version-Release number of selected component (if applicable):
dnf5-5.2.12.0-4.el10_1.x86_64

Steps to Reproduce:
1. Install packages from epel 10 with dnf5
2.
3.

Actual results:
el10_1 packages installed

# dnf5 distro-sync  dnf5
Updating and loading repositories:
Repositories loaded.
Package                           Arch          Version            Repository           Size
Upgrading:
 dnf5                             x86_64        5.2.12.0-4.el10_1  epel              2.3 MiB
   replacing dnf5                 x86_64        5.2.12.0-4.el10_0  <unknown>         2.3 MiB
 dnf5-plugins                     x86_64        5.2.12.0-4.el10_1  epel              1.2 MiB
   replacing dnf5-plugins         x86_64        5.2.12.0-4.el10_0  <unknown>         1.2 MiB
 libdnf5                          x86_64        5.2.12.0-4.el10_1  epel              3.6 MiB
   replacing libdnf5              x86_64        5.2.12.0-4.el10_0  <unknown>         3.6 MiB
 libdnf5-cli                      x86_64        5.2.12.0-4.el10_1  epel            879.4 KiB
   replacing libdnf5-cli          x86_64        5.2.12.0-4.el10_0  <unknown>       879.4 KiB

Transaction Summary:
 Upgrading:          4 packages
 Replacing:          4 packages

Total size of inbound packages is 3 MiB. Need to download 3 MiB.
After this operation, 48 B extra will be used (install 8 MiB, remove 8 MiB).
Is this ok [y/N]: y
[1/4] libdnf5-cli-0:5.2.12.0-4.el10_1.x86_64                   100% |   1.9 MiB/s | 356.9 KiB |  00m00s
[2/4] dnf5-0:5.2.12.0-4.el10_1.x86_64                          100% |   3.7 MiB/s | 825.3 KiB |  00m00s
[3/4] dnf5-plugins-0:5.2.12.0-4.el10_1.x86_64                  100% |   4.5 MiB/s | 437.7 KiB |  00m00s
[4/4] libdnf5-0:5.2.12.0-4.el10_1.x86_64                       100% |   3.1 MiB/s |   1.2 MiB |  00m00s
-------------------------------------------------------------------------------------------------------
[4/4] Total                                                    100% |   2.5 MiB/s |   2.8 MiB |  00m01s
Running transaction
[ 1/10] Verify package files                                   100% | 444.0   B/s |   4.0   B |  00m00s
[ 2/10] Prepare transaction                                    100% | 347.0   B/s |   8.0   B |  00m00s
[ 3/10] Upgrading libdnf5-0:5.2.12.0-4.el10_1.x86_64           100% | 328.2 MiB/s |   3.6 MiB |  00m00s
[ 4/10] Upgrading libdnf5-cli-0:5.2.12.0-4.el10_1.x86_64       100% | 287.5 MiB/s | 883.3 KiB |  00m00s
[ 5/10] Upgrading dnf5-plugins-0:5.2.12.0-4.el10_1.x86_64      100% | 246.5 MiB/s |   1.2 MiB |  00m00s
[ 6/10] Upgrading dnf5-0:5.2.12.0-4.el10_1.x86_64              100% | 153.8 MiB/s |   2.3 MiB |  00m00s
[ 7/10] Removing dnf5-0:5.2.12.0-4.el10_0.x86_64               100% |   7.7 KiB/s |  95.0   B |  00m00s
[ 8/10] Removing dnf5-plugins-0:5.2.12.0-4.el10_0.x86_64       100% | 114.3 KiB/s | 117.0   B |  00m00s
[ 9/10] Removing libdnf5-cli-0:5.2.12.0-4.el10_0.x86_64        100% |   0.0   B/s |  24.0   B |  00m00s
[10/10] Removing libdnf5-0:5.2.12.0-4.el10_0.x86_64            100% | 569.0   B/s |  49.0   B |  00m00s
Complete!


Expected results:
dnf installs el10_0 packages

# dnf reinstall dnf5
AlmaLinux 10 - AppStream                         3.0 MB/s | 2.1 MB     00:00    
AlmaLinux 10 - BaseOS                            7.7 MB/s |  13 MB     00:01    
AlmaLinux 10 - CRB                               999 kB/s | 488 kB     00:00    
AlmaLinux 10 - Extras                             21 kB/s |  11 kB     00:00    
Extra Packages for Enterprise Linux 10 - x86_64  6.7 MB/s | 4.7 MB     00:00    
Installed package dnf5-5.2.12.0-4.el10_1.x86_64 not available.
Error: No packages marked for reinstall.
[root@el10 ~]# dnf distro-sync  dnf5
Last metadata expiration check: 0:00:16 ago on Sat Sep 13 02:42:02 2025.
Dependencies resolved.
=====================================================================================================
 Package             Architecture        Version                      Repository                Size
=====================================================================================================
Downgrading:
 dnf5                x86_64              5.2.12.0-4.el10_0            epel                     825 k
 dnf5-plugins        x86_64              5.2.12.0-4.el10_0            epel                     438 k
 libdnf5             x86_64              5.2.12.0-4.el10_0            epel                     1.2 M
 libdnf5-cli         x86_64              5.2.12.0-4.el10_0            epel                     357 k

Transaction Summary
=====================================================================================================
Downgrade  4 Packages

Total download size: 2.8 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): dnf5-plugins-5.2.12.0-4.el10_0.x86_64.rpm          2.0 MB/s | 438 kB     00:00    
(2/4): dnf5-5.2.12.0-4.el10_0.x86_64.rpm                  3.2 MB/s | 825 kB     00:00    
(3/4): libdnf5-cli-5.2.12.0-4.el10_0.x86_64.rpm           4.2 MB/s | 357 kB     00:00    
(4/4): libdnf5-5.2.12.0-4.el10_0.x86_64.rpm               3.6 MB/s | 1.2 MB     00:00    
------------------------------------------------------------------------------------------
Total                                                     5.4 MB/s | 2.8 MB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                  1/1 
  Downgrading      : libdnf5-5.2.12.0-4.el10_0.x86_64                                 1/8 
  Downgrading      : libdnf5-cli-5.2.12.0-4.el10_0.x86_64                             2/8 
  Downgrading      : dnf5-plugins-5.2.12.0-4.el10_0.x86_64                            3/8 
  Downgrading      : dnf5-5.2.12.0-4.el10_0.x86_64                                    4/8 
  Running scriptlet: dnf5-5.2.12.0-4.el10_0.x86_64                                    4/8 
  Running scriptlet: dnf5-5.2.12.0-4.el10_1.x86_64                                    5/8 
  Cleanup          : dnf5-5.2.12.0-4.el10_1.x86_64                                    5/8 
  Running scriptlet: dnf5-5.2.12.0-4.el10_1.x86_64                                    5/8 
  Cleanup          : dnf5-plugins-5.2.12.0-4.el10_1.x86_64                            6/8 
  Cleanup          : libdnf5-cli-5.2.12.0-4.el10_1.x86_64                             7/8 
  Cleanup          : libdnf5-5.2.12.0-4.el10_1.x86_64                                 8/8 
  Running scriptlet: libdnf5-5.2.12.0-4.el10_1.x86_64                                 8/8 

Downgraded:
  dnf5-5.2.12.0-4.el10_0.x86_64           dnf5-plugins-5.2.12.0-4.el10_0.x86_64           libdnf5-5.2.12.0-4.el10_0.x86_64           libdnf5-cli-5.2.12.0-4.el10_0.x86_64          

Complete!



Additional info:
With option --releasever=10.0 el10_0 packages installed

# dnf5 distro-sync dnf5 --releasever=10.0
Updating and loading repositories:
Repositories loaded.
Package                    Arch          Version                 Repository         Size
Downgrading:
 dnf5                      x86_64        5.2.12.0-4.el10_0       epel            2.3 MiB
   replacing dnf5          x86_64        5.2.12.0-4.el10_1       epel            2.3 MiB
 dnf5-plugins              x86_64        5.2.12.0-4.el10_0       epel            1.2 MiB
   replacing dnf5-plugins  x86_64        5.2.12.0-4.el10_1       epel            1.2 MiB
 libdnf5                   x86_64        5.2.12.0-4.el10_0       epel            3.6 MiB
   replacing libdnf5       x86_64        5.2.12.0-4.el10_1       epel            3.6 MiB
 libdnf5-cli               x86_64        5.2.12.0-4.el10_0       epel          879.4 KiB
   replacing libdnf5-cli   x86_64        5.2.12.0-4.el10_1       epel          879.4 KiB

Transaction Summary:
 Replacing:          4 packages
 Downgrading:        4 packages

Total size of inbound packages is 3 MiB. Need to download 3 MiB.
After this operation, 48 B will be freed (install 8 MiB, remove 8 MiB).
Is this ok [y/N]: y
[1/4] libdnf5-cli-0:5.2.12.0-4.el10_0.x86_64                   100% |   1.7 MiB/s | 356.9 KiB |  00m00s
[2/4] dnf5-0:5.2.12.0-4.el10_0.x86_64                          100% |   3.0 MiB/s | 825.3 KiB |  00m00s
[3/4] dnf5-plugins-0:5.2.12.0-4.el10_0.x86_64                  100% |   3.9 MiB/s | 437.7 KiB |  00m00s
[4/4] libdnf5-0:5.2.12.0-4.el10_0.x86_64                       100% |   3.2 MiB/s |   1.2 MiB |  00m00s
-------------------------------------------------------------------------------------------------------
[4/4] Total                                                    100% |   2.5 MiB/s |   2.8 MiB |  00m01s
Running transaction
[ 1/10] Verify package files                                   100% | 444.0   B/s |   4.0   B |  00m00s
[ 2/10] Prepare transaction                                    100% | 347.0   B/s |   8.0   B |  00m00s
[ 3/10] Downgrading libdnf5-0:5.2.12.0-4.el10_0.x86_64         100% | 328.1 MiB/s |   3.6 MiB |  00m00s
[ 4/10] Downgrading libdnf5-cli-0:5.2.12.0-4.el10_0.x86_64     100% | 287.5 MiB/s | 883.3 KiB |  00m00s
[ 5/10] Downgrading dnf5-plugins-0:5.2.12.0-4.el10_0.x86_64    100% | 246.5 MiB/s |   1.2 MiB |  00m00s
[ 6/10] Downgrading dnf5-0:5.2.12.0-4.el10_0.x86_64            100% | 192.2 MiB/s |   2.3 MiB |  00m00s
[ 7/10] Removing dnf5-0:5.2.12.0-4.el10_1.x86_64               100% |   7.7 KiB/s |  95.0   B |  00m00s
[ 8/10] Removing dnf5-plugins-0:5.2.12.0-4.el10_1.x86_64       100% | 114.3 KiB/s | 117.0   B |  00m00s
[ 9/10] Removing libdnf5-cli-0:5.2.12.0-4.el10_1.x86_64        100% |   0.0   B/s |  24.0   B |  00m00s
[10/10] Removing libdnf5-0:5.2.12.0-4.el10_1.x86_64            100% | 556.0   B/s |  49.0   B |  00m00s
Complete!

Comment 1 Petr Pisar 2025-09-15 08:46:00 UTC
What is your definition (content of the configuration file in /etc/yum.repos.d directory) of "epel" repository?
What is a content of your /etc/os-release file?
What DNF variables does your DNF5 report (dnf5 --dump-variables)?

Comment 2 nucleo 2025-09-15 14:20:46 UTC
# cat /etc/yum.repos.d/epel.repo 
[epel]
name=Extra Packages for Enterprise Linux $releasever - $basearch
# It is much more secure to use the metalink, but if you wish to use a local mirror
# place its address here.
#baseurl=https://download.example/pub/epel/$releasever${releasever_minor:+z}/Everything/$basearch/
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel${releasever_minor:+-z}-$releasever&arch=$basearch
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$releasever_major
gpgcheck=1
repo_gpgcheck=0
metadata_expire=24h
countme=1
enabled=1

[epel-debuginfo]
name=Extra Packages for Enterprise Linux $releasever - $basearch - Debug
# It is much more secure to use the metalink, but if you wish to use a local mirror
# place its address here.
#baseurl=https://download.example/pub/epel/$releasever${releasever_minor:+z}/Everything/$basearch/debug/
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel${releasever_minor:+-z}-debug-$releasever&arch=$basearch
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$releasever_major
gpgcheck=1
repo_gpgcheck=0
metadata_expire=24h
enabled=0

[epel-source]
name=Extra Packages for Enterprise Linux $releasever - $basearch - Source
# It is much more secure to use the metalink, but if you wish to use a local mirror
# place its address here.
#baseurl=https://download.example/pub/epel/$releasever${releasever_minor:+z}/Everything/source/tree/
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel${releasever_minor:+-z}-source-$releasever&arch=source
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$releasever_major
gpgcheck=1
repo_gpgcheck=0
metadata_expire=24h
enabled=0


# cat /etc/os-release 
NAME="AlmaLinux"
VERSION="10.0 (Purple Lion)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="10.0"
PLATFORM_ID="platform:el10"
PRETTY_NAME="AlmaLinux 10.0 (Purple Lion)"
ANSI_COLOR="0;34"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:almalinux:almalinux:10::baseos"
HOME_URL="https://almalinux.org/"
DOCUMENTATION_URL="https://wiki.almalinux.org/"
VENDOR_NAME="AlmaLinux"
VENDOR_URL="https://almalinux.org/"
BUG_REPORT_URL="https://bugs.almalinux.org/"

ALMALINUX_MANTISBT_PROJECT="AlmaLinux-10"
ALMALINUX_MANTISBT_PROJECT_VERSION="10.0"
REDHAT_SUPPORT_PRODUCT="AlmaLinux"
REDHAT_SUPPORT_PRODUCT_VERSION="10.0"
SUPPORT_END=2035-06-01


# dnf5 --dump-variables
======== Variables: ========
arch = x86_64
basearch = x86_64
releasever = 10
releasever_major = 10
stream = 10-stream

Comment 3 Petr Pisar 2025-09-15 15:01:47 UTC
The dump of variables is missing a releasever_minor variable set to "0". Therefore the metalink expands to …?repo=epel-10&…. And metalink server returns addresses for "10.2" now.

So the problem is why releasever_minor variable is not set to 0. I think that DNF5 computes the value from releasever which is obtained from these RPM provides in this order:

    "system-release(releasever)",
    "system-release",
    "distribution-release(releasever)",
    "distribution-release",
    "redhat-release",
    "suse-release"

What package does provide "system-release(releasever) on your system? And that package provides?

Comment 4 Petr Pisar 2025-09-15 15:08:38 UTC
Intepretation of system-release(releasever_major) and system-release(releasever_minor) provides is not yet implemented <https://github.com/rpm-software-management/dnf5/issues/2400>. But still the code should derive from "system-release(releasever)". That could be a genuine bug. It at least does not work for me.

Comment 5 nucleo 2025-09-15 17:45:18 UTC
# rpm -q --provides almalinux-release
almalinux-release = 10.0-32.el10
almalinux-release(x86-64) = 10.0-32.el10
base-module(platform:el10)
centos-release = 10.0-32.el10
centos-release-eula
config(almalinux-release) = 10.0-32.el10
redhat-release = 10.0-32.el10
redhat-release-eula
rpm_macro(almalinux)
rpm_macro(almalinux_ver)
rpm_macro(centos)
rpm_macro(centos_ver)
rpm_macro(dist)
rpm_macro(dist_bug_report_url)
rpm_macro(dist_home_url)
rpm_macro(dist_name)
rpm_macro(dist_vendor)
rpm_macro(distcore)
rpm_macro(el10)
rpm_macro(rhel)
system-release = 10.0-32.el10
system-release(releasever) = 10
system-release(releasever_major) = 10
system-release(releasever_minor) = 0

Comment 6 Petr Pisar 2025-09-16 07:58:32 UTC
Looking at this problem again, I think it equivalent to the already mentioned <https://github.com/rpm-software-management/dnf5/issues/2400>.

DNF5 reads releasever from system-release(releasever) and that is set to "10", not "10.0" for backward compatibility.

As a workaround, you can explicitly pass --releasever 10.0 option to your DNF5 invocations.

Comment 7 nucleo 2025-10-08 22:06:40 UTC
As workaround also can be echo "10.0" > /etc/dnf/vars/releasever
But issue already fixed on github.

Comment 8 nucleo 2025-10-24 00:50:30 UTC
https://koji.fedoraproject.org/koji/taskinfo?taskID=138391703

Scratch build with backported releasever fix works as expected installing el10_0 packages from epel

# dnf5 install htop
Updating and loading repositories:
Repositories loaded.
Package                          Arch    Version         Repository        Size
Installing:
 htop                            x86_64  3.3.0-5.el10_0  epel         448.4 KiB
Installing dependencies:
 hwdata                          noarch  0.379-10.4.el10 baseos         9.4 MiB
 hwloc-libs                      x86_64  2.11.1-3.el10   baseos         2.9 MiB
 libnl3                          x86_64  3.11.0-1.el10   baseos         1.0 MiB
 libpciaccess                    x86_64  0.16-16.el10    baseos        44.5 KiB
 ocl-icd                         x86_64  2.3.2-8.el10    baseos       194.7 KiB

Transaction Summary:
 Installing:         6 packages

Comment 9 nucleo 2025-10-24 11:09:58 UTC
Old version

# dnf5 --version 
dnf5 version 5.2.12.0
dnf5 plugin API version 2.0
libdnf5 version 5.2.12.0
libdnf5 plugin API version 2.2

Loaded dnf5 plugins:
  name: builddep
  version: 1.0.0
  API version: 2.0

  name: changelog
  version: 1.0.0
  API version: 2.0

  name: config-manager
  version: 0.1.0
  API version: 2.0

  name: copr
  version: 0.1.0
  API version: 2.0

  name: needs_restarting
  version: 1.0.0
  API version: 2.0

  name: repoclosure
  version: 1.0.0
  API version: 2.0

  name: reposync
  version: 1.0.0
  API version: 2.0


# dnf5 --dump-variables
======== Variables: ========
arch = x86_64
basearch = x86_64
releasever = 10
releasever_major = 10
stream = 10-stream


Fixed version

# dnf5 --version 
dnf5 version 5.2.13.1
dnf5 plugin API version 2.0
libdnf5 version 5.2.13.1
libdnf5 plugin API version 2.2

Loaded dnf5 plugins:
  name: builddep
  version: 1.0.0
  API version: 2.0

  name: changelog
  version: 1.0.0
  API version: 2.0

  name: config-manager
  version: 0.1.0
  API version: 2.0

  name: copr
  version: 0.1.0
  API version: 2.0

  name: needs_restarting
  version: 1.0.0
  API version: 2.0

  name: repoclosure
  version: 1.0.0
  API version: 2.0

  name: reposync
  version: 1.0.0
  API version: 2.0


# dnf5 --dump-variables
======== Variables: ========
arch = x86_64
basearch = x86_64
releasever = 10
releasever_major = 10
releasever_minor = 0
stream = 10-stream


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