From 104496d9fd142ae59f7adc9d5e6a59ac4a129111 Mon Sep 17 00:00:00 2001 From: Master3395 Date: Fri, 19 Sep 2025 01:19:49 +0200 Subject: [PATCH] Update CyberPanel installer scripts to support additional operating systems and versions. Enhance OS detection logic in install.sh and cyberpanel_upgrade.sh for CentOS 9, CentOS Stream 9, Rocky Linux 9, RHEL 8, RHEL 9, and Debian 11-13. Revise README.md to reflect updated support details and clarify compatibility. Improve error messages for unsupported OS detection. --- README.md | 5 ++++ cyberpanel_upgrade.sh | 10 ++++---- install.sh | 52 +++++++++++++++++++++++++++++++++++++++- install/install_utils.py | 16 ++++++++++++- 4 files changed, 77 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3ced9a731..570296250 100755 --- a/README.md +++ b/README.md @@ -82,6 +82,7 @@ CyberPanel runs on x86_64 architecture and supports the following operating syst - **Ubuntu 24.04.3** - Supported until April 2029 ⭐ **NEW!** - **Ubuntu 22.04** - Supported until April 2027 - **Ubuntu 20.04** - Supported until April 2025 +- **Ubuntu 18.04** - Supported until April 2023 - **Debian 13** - Supported until 2029 ⭐ **NEW!** - **Debian 12** - Supported until 2027 - **Debian 11** - Supported until 2026 @@ -93,7 +94,11 @@ CyberPanel runs on x86_64 architecture and supports the following operating syst - **RHEL 9** - Supported until May 2032 - **RHEL 8** - Supported until May 2029 - **CloudLinux 8** - Supported until May 2029 +- **CloudLinux 7** - Supported until June 2024 - **CentOS 9** - Supported until May 2027 +- **CentOS 8** - Supported until December 2021 +- **CentOS 7** - Supported until June 2024 +- **CentOS Stream 9** - Supported until May 2027 ### **🔧 Third-Party OS Support** diff --git a/cyberpanel_upgrade.sh b/cyberpanel_upgrade.sh index ead637971..9b9f7000a 100644 --- a/cyberpanel_upgrade.sh +++ b/cyberpanel_upgrade.sh @@ -4,7 +4,7 @@ #set -x #set -u -#CyberPanel installer script for CentOS 7, CentOS 8, CloudLinux 7, AlmaLinux 8, AlmaLinux 9, AlmaLinux 10, RockyLinux 8, Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, Ubuntu 24.04, Ubuntu 24.04.3, openEuler 20.03 and openEuler 22.03 +#CyberPanel installer script for CentOS 7, CentOS 8, CentOS 9, CentOS Stream 9, CloudLinux 7, CloudLinux 8, AlmaLinux 8, AlmaLinux 9, AlmaLinux 10, RockyLinux 8, RockyLinux 9, RHEL 8, RHEL 9, Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, Ubuntu 24.04, Ubuntu 24.04.3, Debian 11, Debian 12, Debian 13, openEuler 20.03 and openEuler 22.03 #For whoever may edit this script, please follow: #Please use Pre_Install_xxx() and Post_Install_xxx() if you want to something respectively before or after the panel installation #and update below accordingly @@ -141,7 +141,7 @@ if ! uname -m | grep -qE 'x86_64|aarch64' ; then exit fi -if grep -q -E "CentOS Linux 7|CentOS Linux 8|CentOS Stream" /etc/os-release ; then +if grep -q -E "CentOS Linux 7|CentOS Linux 8|CentOS Linux 9|CentOS Stream 9" /etc/os-release ; then Server_OS="CentOS" elif grep -q "Red Hat Enterprise Linux" /etc/os-release ; then Server_OS="RedHat" @@ -153,12 +153,14 @@ elif grep -q -E "AlmaLinux-8|AlmaLinux-9|AlmaLinux-10" /etc/os-release ; then Server_OS="AlmaLinux" elif grep -q -E "Ubuntu 18.04|Ubuntu 20.04|Ubuntu 20.10|Ubuntu 22.04|Ubuntu 24.04" /etc/os-release ; then Server_OS="Ubuntu" +elif grep -q -E "Debian GNU/Linux 11|Debian GNU/Linux 12|Debian GNU/Linux 13" /etc/os-release ; then + Server_OS="Ubuntu" elif grep -q -E "openEuler 20.03|openEuler 22.03" /etc/os-release ; then Server_OS="openEuler" else echo -e "Unable to detect your system..." - echo -e "\nCyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, Ubuntu 24.04, Ubuntu 24.04.3, CentOS 7, CentOS 8, AlmaLinux 8, AlmaLinux 9, AlmaLinux 10, RockyLinux 8, CloudLinux 7, CloudLinux 8, CloudLinux 9, openEuler 20.03, openEuler 22.03...\n" - Debug_Log2 "CyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, Ubuntu 24.04, Ubuntu 24.04.3, CentOS 7, CentOS 8, AlmaLinux 8, AlmaLinux 9, AlmaLinux 10, RockyLinux 8, CloudLinux 7, CloudLinux 8, CloudLinux 9, openEuler 20.03, openEuler 22.03... [404]" + echo -e "\nCyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, Ubuntu 24.04, Ubuntu 24.04.3, Debian 11, Debian 12, Debian 13, CentOS 7, CentOS 8, CentOS 9, CentOS Stream 9, AlmaLinux 8, AlmaLinux 9, AlmaLinux 10, RockyLinux 8, RockyLinux 9, RHEL 8, RHEL 9, CloudLinux 7, CloudLinux 8, CloudLinux 9, openEuler 20.03, openEuler 22.03...\n" + Debug_Log2 "CyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, Ubuntu 24.04, Ubuntu 24.04.3, Debian 11, Debian 12, Debian 13, CentOS 7, CentOS 8, CentOS 9, CentOS Stream 9, AlmaLinux 8, AlmaLinux 9, AlmaLinux 10, RockyLinux 8, RockyLinux 9, RHEL 8, RHEL 9, CloudLinux 7, CloudLinux 8, CloudLinux 9, openEuler 20.03, openEuler 22.03... [404]" exit fi diff --git a/install.sh b/install.sh index 28ae56bdb..2ba60744d 100644 --- a/install.sh +++ b/install.sh @@ -11,6 +11,11 @@ elif echo $OUTPUT | grep -q "CentOS Linux 8" ; then SERVER_OS="CentOS8" yum install curl wget -y 1> /dev/null yum update curl wget ca-certificates -y 1> /dev/null +elif echo $OUTPUT | grep -q "CentOS Stream 9" ; then + echo -e "\nDetecting Centos Stream 9...\n" + SERVER_OS="CentOS8" +yum install curl wget -y 1> /dev/null +yum update curl wget ca-certificates -y 1> /dev/null elif echo $OUTPUT | grep -q "AlmaLinux 8" ; then echo -e "\nDetecting AlmaLinux 8...\n" SERVER_OS="CentOS8" @@ -45,6 +50,43 @@ apt install -y -qq wget curl elif echo $OUTPUT | grep -q "Ubuntu 22.04" ; then apt install -y -qq wget curl SERVER_OS="Ubuntu" +elif echo $OUTPUT | grep -q "Ubuntu 24.04" ; then +apt install -y -qq wget curl + SERVER_OS="Ubuntu" +elif echo $OUTPUT | grep -q "Debian GNU/Linux 11" ; then +apt install -y -qq wget curl + SERVER_OS="Ubuntu" +elif echo $OUTPUT | grep -q "Debian GNU/Linux 12" ; then +apt install -y -qq wget curl + SERVER_OS="Ubuntu" +elif echo $OUTPUT | grep -q "Debian GNU/Linux 13" ; then +apt install -y -qq wget curl + SERVER_OS="Ubuntu" +elif echo $OUTPUT | grep -q "Rocky Linux 8" ; then + echo -e "\nDetecting Rocky Linux 8...\n" + SERVER_OS="CentOS8" +yum install curl wget -y 1> /dev/null +yum update curl wget ca-certificates -y 1> /dev/null +elif echo $OUTPUT | grep -q "Rocky Linux 9" ; then + echo -e "\nDetecting Rocky Linux 9...\n" + SERVER_OS="CentOS8" +yum install curl wget -y 1> /dev/null +yum update curl wget ca-certificates -y 1> /dev/null +elif echo $OUTPUT | grep -q "Red Hat Enterprise Linux 8" ; then + echo -e "\nDetecting RHEL 8...\n" + SERVER_OS="CentOS8" +yum install curl wget -y 1> /dev/null +yum update curl wget ca-certificates -y 1> /dev/null +elif echo $OUTPUT | grep -q "Red Hat Enterprise Linux 9" ; then + echo -e "\nDetecting RHEL 9...\n" + SERVER_OS="CentOS8" +yum install curl wget -y 1> /dev/null +yum update curl wget ca-certificates -y 1> /dev/null +elif echo $OUTPUT | grep -q "CentOS Linux 9" ; then + echo -e "\nDetecting CentOS 9...\n" + SERVER_OS="CentOS8" +yum install curl wget -y 1> /dev/null +yum update curl wget ca-certificates -y 1> /dev/null elif echo $OUTPUT | grep -q "openEuler 20.03" ; then echo -e "\nDetecting openEuler 20.03...\n" SERVER_OS="openEuler" @@ -58,7 +100,15 @@ yum update curl wget ca-certificates -y 1> /dev/null else echo -e "\nUnable to detect your OS...\n" - echo -e "\nCyberPanel is supported on Ubuntu 18.04, Ubuntu 20.04 Ubuntu 22.04, AlmaLinux 8, AlmaLinux 9, AlmaLinux 10 and CloudLinux 7.x...\n" + echo -e "\nCyberPanel is supported on:\n" + echo -e "Ubuntu: 18.04, 20.04, 22.04, 24.04.3\n" + echo -e "Debian: 11, 12, 13\n" + echo -e "AlmaLinux: 8, 9, 10\n" + echo -e "RockyLinux: 8, 9\n" + echo -e "RHEL: 8, 9\n" + echo -e "CentOS: 7, 8, 9, Stream 9\n" + echo -e "CloudLinux: 7.x, 8\n" + echo -e "openEuler: 20.03, 22.03\n" exit 1 fi diff --git a/install/install_utils.py b/install/install_utils.py index 17efe4a5e..07982c0c0 100644 --- a/install/install_utils.py +++ b/install/install_utils.py @@ -34,6 +34,14 @@ def FetchCloudLinuxAlmaVersionVersion(): return 'al-87' elif (data.find('AlmaLinux') > -1 or data.find('almalinux') > -1) and (data.find('9.4') > -1 or data.find('9.3') > -1 or data.find('Shamrock Pampas') > -1 or data.find('Seafoam Ocelot') > -1 or data.find('VERSION="9.') > -1): return 'al-93' + elif data.find('CentOS Stream 9') > -1: + return 'el-9' + elif data.find('CentOS Linux 9') > -1: + return 'el-9' + elif data.find('Rocky Linux 9') > -1: + return 'el-9' + elif data.find('Red Hat Enterprise Linux 9') > -1: + return 'el-9' elif (data.find('AlmaLinux') > -1 or data.find('almalinux') > -1) and (data.find('10.0') > -1 or data.find('Purple Lion') > -1 or data.find('VERSION="10.') > -1): return 'al-100' else: @@ -326,12 +334,18 @@ def get_distro(): if data.find('CentOS Linux release 8') > -1: return cent8 + if data.find('CentOS Linux release 9') > -1 or data.find('CentOS Stream 9') > -1: + return cent8 + if data.find('Rocky Linux release 9') > -1 or data.find('Rocky Linux 9') > -1: + return cent8 + if data.find('Red Hat Enterprise Linux 8') > -1 or data.find('Red Hat Enterprise Linux 9') > -1: + return cent8 ## if almalinux 9 or 10 then pretty much same as cent8 if data.find('AlmaLinux release 8') > -1 or data.find('AlmaLinux release 9') > -1 or data.find('AlmaLinux release 10') > -1: return cent8 if data.find('Rocky Linux release 8') > -1 or data.find('Rocky Linux 8') > -1 or data.find('rocky:8') > -1: return cent8 - if data.find('CloudLinux 8') or data.find('cloudlinux 8'): + if data.find('CloudLinux 8') or data.find('cloudlinux 8') or data.find('CloudLinux 9') or data.find('cloudlinux 9'): return cent8 else: