From 5dceebb5c4ca5b3d6816bfdfad9b604b8928e542 Mon Sep 17 00:00:00 2001 From: moth Date: Wed, 18 Mar 2026 18:20:43 -0600 Subject: [PATCH] update shell-lib for RHEL/CentOS 9 support --- shell-lib/acmlib.sh | 5 ++--- shell-lib/docker/install_docker.sh | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/shell-lib/acmlib.sh b/shell-lib/acmlib.sh index 9324db2..068b0ef 100644 --- a/shell-lib/acmlib.sh +++ b/shell-lib/acmlib.sh @@ -450,9 +450,8 @@ ensure_common_tools_installed () { $SUDO yum -y -q -e 0 install yum-utils fi - #Addresses AC-Hunter issue #2185 - if [ -x /usr/bin/subscription-manager ]; then #Only attempt this on RHEL, not Centos or other clones - #Note, when extending to other RHEL releases (>7.x) we'll need to test for the release version and adjust the repository name. + #Enable extra repository for RHEL 7.x (addresses AC-Hunter issue #2185) + if [ -x /usr/bin/subscription-manager -a -s /etc/redhat-release ] && grep -iq 'release 7' /etc/redhat-release ; then $SUDO subscription-manager repos --enable=rhel-7-server-extras-rpms fi diff --git a/shell-lib/docker/install_docker.sh b/shell-lib/docker/install_docker.sh index f018e05..e50265f 100755 --- a/shell-lib/docker/install_docker.sh +++ b/shell-lib/docker/install_docker.sh @@ -91,7 +91,10 @@ elif [ -s /etc/redhat-release ] && grep -iq 'release 7\|release 8\|release 9' /e $SUDO yum -y -q -e 0 install yum-utils device-mapper-persistent-data lvm2 shadow-utils - $SUDO yum-config-manager -q --enable extras >/dev/null + # Enable "extras" repo if not RHEL or CentOS Stream + if ! grep -iq 'red hat enterprise linux\|centos stream' /etc/redhat-release; then + $SUDO yum-config-manager -q --enable extras >/dev/null + fi if [ ! -f /etc/yum.repos.d/docker-ce.repo ]; then $SUDO yum-config-manager -q --add-repo https://download.docker.com/linux/centos/docker-ce.repo > /dev/null