diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index 781bc51a4..dec908796 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -274,7 +274,7 @@ def installMySQL(self, mysql): install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR, True) 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) + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR, True) command = "mkdir -p /etc/apt/keyrings" install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) @@ -299,12 +299,12 @@ def installMySQL(self, mysql): WriteToFile.close() - command = "DEBIAN_FRONTEND=noninteractive sudo apt-get install mariadb-server -y" + command = "DEBIAN_FRONTEND=noninteractive apt-get install mariadb-server -y" elif self.distro == centos: RepoPath = '/etc/yum.repos.d/mariadb.repo' RepoContent = f""" - [mariadb] +[mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.11/rhel8-amd64 module_hotfixes=1 @@ -317,19 +317,20 @@ def installMySQL(self, mysql): 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: -# content = """ -# [mariadb] -# name = MariaDB -# baseurl = http://yum.mariadb.org/10.6/rhel8-amd64 -# module_hotfixes=1 -# gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB -# gpgcheck=1 -# """ -# writeToFile = open('/etc/yum.repos.d/mariadb.repo', 'w') -# writeToFile.write(content) -# writeToFile.close() + + 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 -y install mariadb-server'