From 70163e3a506cda9b9e2103cf5c8cade8854761a0 Mon Sep 17 00:00:00 2001 From: master3395 Date: Sat, 14 Feb 2026 22:39:04 +0100 Subject: [PATCH] AlmaLinux 8/9/10 and Ubuntu 22/24 full support - cyberpanel.sh: Add Ubuntu 24.04 detection, update supported-OS message - simple_install.sh: Add Ubuntu 24.04, AlmaLinux 10; use dnf for Alma 8 - cyberpanel_utility.sh: Add Ubuntu 24.04 to OS detection and supported list - CPScripts/mailscanner*.sh: Add Ubuntu 24.04, AlmaLinux 9/10 to supported list - serverStatus/views.py: Prefer dnf.conf for package locks on dnf-based systems - README.md: Recommend AlmaLinux; add aarch64 note - Remove .DS_Store from repo Co-authored-by: Cursor --- .DS_Store | Bin 12292 -> 0 bytes CPScripts/mailscannerinstaller.sh | 4 +- CPScripts/mailscanneruninstaller.sh | 4 +- README.md | 4 +- cyberpanel.sh | 12 +++++- cyberpanel_utility.sh | 4 +- serverStatus/views.py | 60 +++++++++++++++++++++++----- simple_install.sh | 16 ++++++-- 8 files changed, 80 insertions(+), 24 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 497829761e1be59ad1d9b9d682da98859e84886e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12292 zcmeHN%Wfk@6uljX#CZor!vYE69kUrL^ANKF=>NH#AY1ZV<$tx0%gSp z@eBL{;t%)&cKil=R&dU(PEz-F+s?2+0=lE_YPavXRdxH^N0lQY$;Rp7U6I=&QpU-4 zc^;SVL@IM=ql4e`%p4^=NpLoB;(l4=L=L1WJF+L$jCA(F1RfDTiE~ySK~IbyNOPy% zJ=kw|_whZHPreKB#Xt4Hlj0~WP*|X_Kw*Kx0)++sjs=)|ag<%Y4^NA0VS&N||7!~{ zK2&hBT}#`G&}!(wg(W<{X9=$d?oq1ivr5{orR_y%6$*?((FSOeE-{h-$MXus(XOTK zMQ8(Dk^q+^?Kw$TD2etCTt&qtSqp7(Ei6!2AZvjS@MuoH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b7l866|0fj9>n$rfO(HCVYB{cpmW zm(uh#+Ow@QqiuDRR)caV?r&j;hD;@^T#Avma*@w(R!f>$4A;b(jVnOx`(ZYjF{$6g zW10bL>9^c5tV2GtV?h2UixGcw5RO45=*(SV7(JC~;H1niIC CyberPanel targets x86\_64 only. Test the unsupported OS in staging first. +> **Architectures:** x86_64 (primary), aarch64/ARM64 (supported). AlmaLinux is the recommended RHEL-compatible distribution. Test unsupported OS in staging first. --- diff --git a/cyberpanel.sh b/cyberpanel.sh index 52713fb5c..feba43655 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -117,6 +117,11 @@ detect_os() { OS_FAMILY="rhel" PACKAGE_MANAGER="yum" print_status "Detected: Rocky Linux 8" + elif echo $OUTPUT | grep -q "Ubuntu 24.04" ; then + SERVER_OS="Ubuntu2404" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "Detected: Ubuntu 24.04" elif echo $OUTPUT | grep -q "Ubuntu 22.04" ; then SERVER_OS="Ubuntu2204" OS_FAMILY="debian" @@ -127,6 +132,11 @@ detect_os() { OS_FAMILY="debian" PACKAGE_MANAGER="apt" print_status "Detected: Ubuntu 20.04" + elif echo $OUTPUT | grep -q "Debian GNU/Linux 13" ; then + SERVER_OS="Debian13" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "Detected: Debian GNU/Linux 13" elif echo $OUTPUT | grep -q "Debian GNU/Linux 12" ; then SERVER_OS="Debian12" OS_FAMILY="debian" @@ -139,7 +149,7 @@ detect_os() { print_status "Detected: Debian GNU/Linux 11" else print_status "ERROR: Unsupported OS detected" - print_status "Supported OS: AlmaLinux 8/9/10, CentOS 8/9, Rocky Linux 8/9, Ubuntu 20.04/22.04, Debian 11/12" + print_status "Supported OS: AlmaLinux 8/9/10, CentOS 8/9, Rocky Linux 8/9, Ubuntu 20.04/22.04/24.04, Debian 11/12/13" return 1 fi diff --git a/cyberpanel_utility.sh b/cyberpanel_utility.sh index 26c89743a..fad47d35c 100644 --- a/cyberpanel_utility.sh +++ b/cyberpanel_utility.sh @@ -21,7 +21,7 @@ check_OS() { Server_OS="AlmaLinux" elif grep -q -E "CloudLinux 7|CloudLinux 8" /etc/os-release ; then Server_OS="CloudLinux" - elif grep -q -E "Ubuntu 18.04|Ubuntu 20.04|Ubuntu 20.10|Ubuntu 22.04" /etc/os-release ; then + 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 "Rocky Linux" /etc/os-release ; then Server_OS="RockyLinux" @@ -29,7 +29,7 @@ check_OS() { 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, CentOS 7, CentOS 8, AlmaLinux 8, AlmaLinux 9, AlmaLinux 10, RockyLinux 8, CloudLinux 7, CloudLinux 8, openEuler 20.03, openEuler 22.03...\n" + echo -e "\nCyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, Ubuntu 24.04, CentOS 7, CentOS 8, AlmaLinux 8, AlmaLinux 9, AlmaLinux 10, RockyLinux 8, CloudLinux 7, CloudLinux 8, openEuler 20.03, openEuler 22.03...\n" exit fi diff --git a/serverStatus/views.py b/serverStatus/views.py index 8f051b86f..88e4c0295 100644 --- a/serverStatus/views.py +++ b/serverStatus/views.py @@ -884,9 +884,23 @@ def fetchPackages(request): locked = ProcessUtilities.outputExecutioner(command).split('\n') if type == 'CyberPanel': - - command = 'cat /usr/local/CyberCP/AllCPUbuntu.json' - packages = json.loads(ProcessUtilities.outputExecutioner(command)) + # Prefer live data for Ubuntu 22/24, fall back to static JSON + packages = None + try: + cmd_out = ProcessUtilities.outputExecutioner('apt list --installed 2>/dev/null') + lines = [l for l in cmd_out.split('\n') if l and '/' in l][4:] # Skip header + packages = [] + for line in lines: + parts = line.split(None, 2) + if len(parts) >= 2: + packages.append({'Package': parts[0], 'Version': parts[1]}) + except Exception: + pass + if not packages and os.path.exists('/usr/local/CyberCP/AllCPUbuntu.json'): + command = 'cat /usr/local/CyberCP/AllCPUbuntu.json' + packages = json.loads(ProcessUtilities.outputExecutioner(command)) + if not packages: + packages = [] else: command = 'apt list --installed' @@ -906,11 +920,16 @@ def fetchPackages(request): elif ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: ### Check Package Lock status - - if os.path.exists('/etc/yum.conf'): + # Prefer dnf.conf when dnf is present (AlmaLinux 9/10, RHEL 9, Rocky 9) + yum_dnf = 'dnf' if os.path.exists('/usr/bin/dnf') else 'yum' + if yum_dnf == 'dnf' and os.path.exists('/etc/dnf/dnf.conf'): + yumConf = '/etc/dnf/dnf.conf' + elif os.path.exists('/etc/yum.conf'): yumConf = '/etc/yum.conf' elif os.path.exists('/etc/yum/yum.conf'): yumConf = '/etc/yum/yum.conf' + else: + yumConf = '/etc/dnf/dnf.conf' if os.path.exists('/etc/dnf/dnf.conf') else '/etc/yum.conf' yumConfData = open(yumConf, 'r').read() locked = [] @@ -930,7 +949,7 @@ def fetchPackages(request): startForUpdate = 1 - command = 'yum check-update' + command = '%s check-update 2>/dev/null || true' % yum_dnf updates = ProcessUtilities.outputExecutioner(command).split('\n') for items in updates: @@ -948,7 +967,7 @@ def fetchPackages(request): ### - command = 'yum list installed' + command = '%s list installed' % yum_dnf packages = ProcessUtilities.outputExecutioner(command).split('\n') startFrom = 1 @@ -964,7 +983,7 @@ def fetchPackages(request): startForUpdate = 1 - command = 'yum check-update' + command = '%s check-update 2>/dev/null || true' % yum_dnf packages = ProcessUtilities.outputExecutioner(command).split('\n') for items in packages: @@ -974,8 +993,26 @@ def fetchPackages(request): else: startForUpdate = startForUpdate + 1 elif type == 'CyberPanel': - command = 'cat /usr/local/CyberCP/CPCent7repo.json' - packages = json.loads(ProcessUtilities.outputExecutioner(command)) + # Prefer live data for AlmaLinux 8/9/10, RHEL, Rocky; fall back to static JSON + packages = None + try: + dnf_cmd = 'dnf list installed' if os.path.exists('/usr/bin/dnf') else 'yum list installed' + cmd_out = ProcessUtilities.outputExecutioner(dnf_cmd) + lines = [l.strip() for l in cmd_out.split('\n') if l.strip()] + idx = next((i for i, l in enumerate(lines) if 'Installed Packages' in l or 'Installed' in l), 0) + lines = lines[idx + 1:] if idx < len(lines) else lines + packages = [] + for line in lines: + parts = line.split() + if len(parts) >= 2: + packages.append({'Package': parts[0], 'Version': parts[1]}) + except Exception: + pass + if not packages and os.path.exists('/usr/local/CyberCP/CPCent7repo.json'): + command = 'cat /usr/local/CyberCP/CPCent7repo.json' + packages = json.loads(ProcessUtilities.outputExecutioner(command)) + if not packages: + packages = [] ## make list of packages that need update @@ -1131,7 +1168,8 @@ def fetchPackageDetails(request): command = 'apt-cache show %s' % (package) packageDetails = ProcessUtilities.outputExecutioner(command) elif ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: - command = 'yum info %s' % (package) + pkg_cmd = 'dnf info' if os.path.exists('/usr/bin/dnf') else 'yum info' + command = '%s %s' % (pkg_cmd, package) packageDetails = ProcessUtilities.outputExecutioner(command) data_ret = {'status': 1, 'packageDetails': packageDetails} diff --git a/simple_install.sh b/simple_install.sh index 3d3cdb5b8..f22f256e2 100644 --- a/simple_install.sh +++ b/simple_install.sh @@ -6,14 +6,22 @@ OUTPUT=$(cat /etc/*release) # Detect OS and set appropriate variables -if echo $OUTPUT | grep -q "AlmaLinux 9" ; then +if echo $OUTPUT | grep -q "AlmaLinux 10" ; then + echo -e "\nDetecting AlmaLinux 10...\n" + SERVER_OS="AlmaLinux10" + PKG_MGR="dnf" +elif echo $OUTPUT | grep -q "AlmaLinux 9" ; then echo -e "\nDetecting AlmaLinux 9...\n" SERVER_OS="AlmaLinux9" PKG_MGR="dnf" elif echo $OUTPUT | grep -q "AlmaLinux 8" ; then echo -e "\nDetecting AlmaLinux 8...\n" SERVER_OS="AlmaLinux8" - PKG_MGR="yum" + PKG_MGR="dnf" +elif echo $OUTPUT | grep -q "Ubuntu 24.04" ; then + echo -e "\nDetecting Ubuntu 24.04...\n" + SERVER_OS="Ubuntu2404" + PKG_MGR="apt" elif echo $OUTPUT | grep -q "Ubuntu 22.04" ; then echo -e "\nDetecting Ubuntu 22.04...\n" SERVER_OS="Ubuntu2204" @@ -28,8 +36,8 @@ elif echo $OUTPUT | grep -q "CentOS Linux 8" ; then PKG_MGR="yum" else echo -e "\nUnsupported OS detected. This script supports:\n" - echo -e "AlmaLinux: 8, 9\n" - echo -e "Ubuntu: 20.04, 22.04\n" + echo -e "AlmaLinux: 8, 9, 10\n" + echo -e "Ubuntu: 20.04, 22.04, 24.04\n" echo -e "CentOS: 8\n" exit 1 fi