Skip to content

Commit

Permalink
CentOS/RHEL: Use dnf if available
Browse files Browse the repository at this point in the history
... instead of yum. The yum command is no longer available by default
in recent versions.

Closes #394

Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
  • Loading branch information
kajinamit committed Feb 10, 2024
1 parent fd82160 commit 084d4ac
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -559,19 +559,24 @@ do_install() {
echo "Packages for RHEL are currently only available for s390x."
exit 1
fi
if [ "$lsb_dist" = "fedora" ]; then

if command_exists dnf; then
pkg_manager="dnf"
config_manager="dnf config-manager"
enable_channel_flag="--set-enabled"
disable_channel_flag="--set-disabled"
pre_reqs="dnf-plugins-core"
pkg_suffix="fc$dist_version"
else
pkg_manager="yum"
config_manager="yum-config-manager"
enable_channel_flag="--enable"
disable_channel_flag="--disable"
pre_reqs="yum-utils"
fi

if [ "$lsb_dist" = "fedora" ]; then
pkg_suffix="fc$dist_version"
else
pkg_suffix="el"
fi
repo_file_url="$DOWNLOAD_URL/linux/$lsb_dist/$REPO_FILE"
Expand Down

0 comments on commit 084d4ac

Please sign in to comment.