Fix OpenFaaS Edge 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 systems.

Tested on Rocky Linux 8 and 9.

Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
This commit is contained in:
Han Verstraete (OpenFaaS Ltd) 2025-05-14 11:49:33 +02:00 committed by Alex Ellis
parent 0ea1bd5ffc
commit 934d326d82

View File

@ -13,8 +13,8 @@ if [ "$EUID" -ne 0 ]; then
exit exit
fi fi
has_yum() { has_dnf() {
[ -n "$(command -v yum)" ] [ -n "$(command -v dnf)" ]
} }
has_apt_get() { has_apt_get() {
@ -37,9 +37,8 @@ install_required_packages() {
# reference: https://github.com/openfaas/faasd/pull/237 # reference: https://github.com/openfaas/faasd/pull/237
apt-get update -yq apt-get update -yq
apt-get install -yq curl runc bridge-utils iptables iptables-persistent apt-get install -yq curl runc bridge-utils iptables iptables-persistent
elif $(has_yum); then elif $(has_dnf); then
yum check-update -y dnf install -y curl runc iptables-services which
yum install -y curl runc iptables-services which
elif $(has_pacman); then elif $(has_pacman); then
pacman -Syy pacman -Syy
pacman -Sy curl runc bridge-utils pacman -Sy curl runc bridge-utils
@ -60,6 +59,7 @@ if [ -z "$SKIP_OS" ]; then
install_required_packages install_required_packages
fi fi
echo ""
echo "2. Downloading OCI image, and installing pre-requisites" echo "2. Downloading OCI image, and installing pre-requisites"
echo "" echo ""
if [ ! -x "$(command -v arkade)" ]; then if [ ! -x "$(command -v arkade)" ]; then