mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-02-16 11:36:48 +01:00
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 <cursoragent@cursor.com>
This commit is contained in:
@@ -55,13 +55,13 @@ elif grep -q -E "CloudLinux 7|CloudLinux 8" /etc/os-release ; then
|
||||
Server_OS="CloudLinux"
|
||||
elif grep -q -E "Rocky Linux" /etc/os-release ; then
|
||||
Server_OS="RockyLinux"
|
||||
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 "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, CentOS 7, CentOS 8, AlmaLinux 8, 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
|
||||
|
||||
|
||||
@@ -12,13 +12,13 @@ elif grep -q -E "CloudLinux 7|CloudLinux 8" /etc/os-release ; then
|
||||
Server_OS="CloudLinux"
|
||||
elif grep -q -E "Rocky Linux" /etc/os-release ; then
|
||||
Server_OS="RockyLinux"
|
||||
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 "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, CentOS 7, CentOS 8, AlmaLinux 8, 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
|
||||
|
||||
|
||||
@@ -71,14 +71,14 @@ Fast • Secure • Scalable — Simplify hosting management with style.
|
||||
| OS family | Recommended / Supported |
|
||||
| -------------------------- | ----------------------: |
|
||||
| Ubuntu 24.04, 22.04, 20.04 | ✅ Recommended |
|
||||
| AlmaLinux 10, 9, 8 | ✅ Recommended |
|
||||
| Debian 13, 12, 11 | ✅ Supported |
|
||||
| AlmaLinux 10, 9, 8 | ✅ Supported |
|
||||
| RockyLinux 9, 8 | ✅ Supported |
|
||||
| RHEL 9, 8 | ✅ Supported |
|
||||
| CloudLinux 9, 8 | ✅ Supported |
|
||||
| CentOS 7 | ⚠️ Legacy — EOL |
|
||||
|
||||
> 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.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user