disable some centos repos

This commit is contained in:
Usman Nasir
2020-04-24 09:58:35 +05:00
parent 3cedd8efac
commit 67c493ca80

View File

@@ -2066,6 +2066,30 @@ vmail
writeToFile.write(content) writeToFile.write(content)
writeToFile.close() 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(): def main():
parser = argparse.ArgumentParser(description='CyberPanel Installer') parser = argparse.ArgumentParser(description='CyberPanel Installer')
@@ -2213,7 +2237,8 @@ def main():
checks.enableDisableFTP('on', distro) checks.enableDisableFTP('on', distro)
checks.installCLScripts() checks.installCLScripts()
checks.disablePackegeUpdates() #checks.disablePackegeUpdates()
checks.enableDisableRepos()
logging.InstallLog.writeToFile("CyberPanel installation successfully completed!") logging.InstallLog.writeToFile("CyberPanel installation successfully completed!")