diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index 9ec655cd7..781bc51a4 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -268,23 +268,54 @@ class InstallCyberPanel: ############## Install mariadb ###################### - mRepo = '/etc/yum.repos.d/MariaDB.repo' - if self.distro == ubuntu: - if get_Ubuntu_release() == 18.10: - command = 'DEBIAN_FRONTEND=noninteractive apt-get install software-properties-common -y' - install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR, True) + command = 'DEBIAN_FRONTEND=noninteractive apt-get install software-properties-common -y' + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR, True) - command = "apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'" - install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + command = "DEBIAN_FRONTEND=noninteractive apt-get install apt-transport-https curl -y" + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) - command = "add-apt-repository 'deb [arch=amd64,arm64,ppc64el] https://mirror.yongbok.net/mariadb/repo/10.4/ubuntu bionic main'" - install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + command = "mkdir -p /etc/apt/keyrings" + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) - command = "DEBIAN_FRONTEND=noninteractive apt-get -y install mariadb-server" + command = "curl -o /etc/apt/keyrings/mariadb-keyring.pgp 'https://mariadb.org/mariadb_release_signing_key.pgp'" + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + RepoPath = '/etc/apt/sources.list.d/mariadb.sources' + RepoContent = f""" +# MariaDB 10.11 repository list - created 2023-12-11 07:53 UTC +# https://mariadb.org/download/ +X-Repolib-Name: MariaDB +Types: deb +# deb.mariadb.org is a dynamic mirror if your preferred mirror goes offline. See https://mariadb.org/mirrorbits/ for details. +# URIs: https://deb.mariadb.org/10.11/ubuntu +URIs: https://mirrors.gigenet.com/mariadb/repo/10.11/ubuntu +Suites: jammy +Components: main main/debug +Signed-By: /etc/apt/keyrings/mariadb-keyring.pgp +""" + WriteToFile = open(RepoPath, 'w') + WriteToFile.write(RepoContent) + WriteToFile.close() + + + command = "DEBIAN_FRONTEND=noninteractive sudo apt-get install mariadb-server -y" elif self.distro == centos: - command = 'yum --enablerepo=mariadb -y install MariaDB-server MariaDB-client' + + RepoPath = '/etc/yum.repos.d/mariadb.repo' + RepoContent = f""" + [mariadb] +name = MariaDB +baseurl = http://yum.mariadb.org/10.11/rhel8-amd64 +module_hotfixes=1 +gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB +gpgcheck=1 +""" + WriteToFile = open(RepoPath, 'w') + WriteToFile.write(RepoContent) + WriteToFile.close() + + command = 'dnf install mariadb-server -y' elif self.distro == cent8 or self.distro == openeuler: ### check if cent8 which means Alma8 then add Mariadb 10.6 repo # if self.distro == cent8: diff --git a/plogical/mysqlUtilities.py b/plogical/mysqlUtilities.py index 09d25ecc0..160575081 100755 --- a/plogical/mysqlUtilities.py +++ b/plogical/mysqlUtilities.py @@ -1173,7 +1173,6 @@ gpgcheck=1 WriteToFile.close() - command = 'dnf update -y' result = ProcessUtilities.outputExecutioner(command, 'root', True)