Fix faasd CE install script for RHEL-based systems

This change removes the check-update command. This command is not
required and caused the script to exit early if packages are not up to
date.

In addition DNF is now used to install packages. DNF is the successor of
YUM on the latest RHEL-based system.

Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
This commit is contained in:
Han Verstraete (OpenFaaS Ltd) 2025-05-20 17:51:29 +02:00 committed by Alex Ellis
parent f409e01aa6
commit 83e804513a

View File

@ -47,8 +47,8 @@ verify_system() {
fi fi
} }
has_yum() { has_dnf() {
[ -n "$(command -v yum)" ] [ -n "$(command -v dnf)" ]
} }
has_apt_get() { has_apt_get() {
@ -67,14 +67,16 @@ install_required_packages() {
# reference: https://github.com/openfaas/faasd/pull/237 # reference: https://github.com/openfaas/faasd/pull/237
$SUDO apt-get update -y $SUDO apt-get update -y
$SUDO apt-get install -y curl runc bridge-utils iptables $SUDO apt-get install -y curl runc bridge-utils iptables
elif $(has_yum); then elif $(has_dnf); then
$SUDO yum check-update -y $SUDO dnf install -y \
$SUDO yum install -y curl runc iptables-services --allowerasing \
--setopt=install_weak_deps=False \
curl runc iptables-services bridge-utils
elif $(has_pacman); then elif $(has_pacman); then
$SUDO pacman -Syy $SUDO pacman -Syy
$SUDO pacman -Sy curl runc bridge-utils $SUDO pacman -Sy curl runc bridge-utils
else else
fatal "Could not find apt-get, yum, or pacman. Cannot install dependencies on this OS." fatal "Could not find apt-get, dnf, or pacman. Cannot install dependencies on this OS."
exit 1 exit 1
fi fi
} }