From a63894df692d78c5a6c74346c46521b5b1f6cb31 Mon Sep 17 00:00:00 2001 From: Morteza Saeed Mohammadi Date: Wed, 19 Mar 2025 11:34:36 +0100 Subject: [PATCH] Fix: Resolve #1332 by detecting AlmaLinux or Rocky Linux and enabling CRB repo correctly --- cyberpanel.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 769e27132..7509a1b4c 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -849,7 +849,17 @@ if [[ $Server_OS = "CentOS" ]] ; then dnf install libxcrypt-compat -y fi - subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms || yum config-manager --set-enabled crb > /dev/null 2>&1 + # check if OS is AlmaLinux + if grep -q -E "AlmaLinux|Rocky Linux" /etc/os-release ; then + # check and install dnf-plugins-core if not installed + rpm -q dnf-plugins-core > /dev/null 2>&1 || dnf install -y dnf-plugins-core + # enable codeready-builder repo for AlmaLinux + dnf config-manager --set-enabled crb > /dev/null 2>&1 + else + # enable codeready-builder repo for Other RHEL Based OS + subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms > /dev/null 2>&1 + fi + yum install -y https://cyberpanel.sh/dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm Check_Return "yum repo" "no_exit" yum install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm