diff --git a/cyberpanel.sh b/cyberpanel.sh index 900ea24ab..979842083 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -1551,3 +1551,22 @@ pip_virtualenv system_tweak main_install + + +### Disable Centos Default Repos + +disable_repos() { + +if [[ $SERVER_OS == "CentOS" ]] ; then + sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Base.repo + sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Debuginfo.repo + sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Media.repo + sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Vault.repo + sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-CR.repo + sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-fasttrack.repo + sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Sources.repo +fi + +} + +disable_repos \ No newline at end of file diff --git a/cyberpanel_upgrade.sh b/cyberpanel_upgrade.sh index c4bee1b24..89aab1782 100644 --- a/cyberpanel_upgrade.sh +++ b/cyberpanel_upgrade.sh @@ -398,6 +398,25 @@ rm -f /usr/local/composer.sh # clean up +### Disable Centos Default Repos + + +disable_repos() { + +if [[ $SERVER_OS == "CentOS" ]] ; then + sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Base.repo + sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Debuginfo.repo + sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Media.repo + sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Vault.repo + sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-CR.repo + sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-fasttrack.repo + sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Sources.repo +fi + +} + +disable_repos + echo "###################################################################" echo " CyberPanel Upgraded " echo "###################################################################" diff --git a/install/install.py b/install/install.py index 2e7ae005b..411534b69 100755 --- a/install/install.py +++ b/install/install.py @@ -2066,31 +2066,6 @@ vmail writeToFile.write(content) writeToFile.close() - def enableDisableRepos(self): - - if self.distro == centos: - command = "sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Base.repo" - preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - - command = "sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Debuginfo.repo" - preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - - command = "sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Media.repo" - preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - - command = "sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Vault.repo" - preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - - command = "sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-CR.repo" - preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - - command = "sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-fasttrack.repo" - preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - - command = "sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Sources.repo" - preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - - def main(): parser = argparse.ArgumentParser(description='CyberPanel Installer') parser.add_argument('publicip', help='Please enter public IP for your VPS or dedicated server.') @@ -2238,7 +2213,6 @@ def main(): checks.installCLScripts() #checks.disablePackegeUpdates() - checks.enableDisableRepos() logging.InstallLog.writeToFile("CyberPanel installation successfully completed!")