Skip to content

fix: detect dnf as package manager in ospkgs and otherpkgs postscripts#7560

Merged
Obihoernchen merged 1 commit into
xcat2:masterfrom
VersatusHPC:fix/otherpkgs-dnf-detection
May 7, 2026
Merged

fix: detect dnf as package manager in ospkgs and otherpkgs postscripts#7560
Obihoernchen merged 1 commit into
xcat2:masterfrom
VersatusHPC:fix/otherpkgs-dnf-detection

Conversation

@viniciusferrao
Copy link
Copy Markdown
Member

On RHEL 9.x minimal installs, the yum package may not exist as a separate RPM. So, only dnf is present with /usr/bin/yum as a symlink. The previous detection using rpm -q yum would fail, causing $hasyum to remain false and skipping repo file creation entirely.

This PR replaces rpm -q based detection with executable checks for /usr/bin/dnf and /usr/bin/yum. Introduce yumcmd variable to carry the actual command name through all package operations instead of hardcoding yum.

$yumcmd can be considered ugly since it may carry dnf but it was the choice to keep intent.

Fixes: #7497

On RHEL 9.x minimal installs, the yum package may not exist as a
separate RPM — only dnf is present with /usr/bin/yum as a symlink.
The previous detection using rpm -q yum would fail, causing hasyum
to remain 0 and skipping repo file creation entirely.

Replace rpm -q based detection with executable checks for /usr/bin/dnf
and /usr/bin/yum. Introduce yumcmd variable to carry the actual command
name through all package operations instead of hardcoding yum.

Fixes: xcat2#7497
@Obihoernchen Obihoernchen added this to the 2.18 milestone May 7, 2026
@Obihoernchen Obihoernchen merged commit 79dd24d into xcat2:master May 7, 2026
2 checks passed
@viniciusferrao viniciusferrao deleted the fix/otherpkgs-dnf-detection branch May 7, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

otherpkgs postscript - installation of rhels9.5

2 participants