Improve apt-get update process
This commit is contained in:
4
install
4
install
@@ -447,8 +447,8 @@ wo_git_config() {
|
||||
fi
|
||||
|
||||
# .gitconfig inital setup
|
||||
#cd /var/lib/wo/tmp/WordOps-install || exit 1
|
||||
#python3 gitconfig.py
|
||||
cd /var/lib/wo/tmp/WordOps-install || exit 1
|
||||
python3 gitconfig.py
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -19,12 +19,21 @@ class WOAptGet():
|
||||
try:
|
||||
with open('/var/log/wo/wordops.log', 'a') as f:
|
||||
proc = subprocess.Popen(
|
||||
'DEBIAN_FRONTEND=noninteractive apt-get update -qq',
|
||||
'DEBIAN_FRONTEND=noninteractive apt-get update -qq '
|
||||
'--allow-releaseinfo-change',
|
||||
shell=True, stdin=None, stdout=f,
|
||||
stderr=subprocess.PIPE, executable="/bin/bash")
|
||||
proc.wait()
|
||||
output, error_output = proc.communicate()
|
||||
|
||||
if "--allow-releaseinfo-change" in str(error_output):
|
||||
proc = subprocess.Popen(
|
||||
'DEBIAN_FRONTEND=noninteractive apt-get update -qq',
|
||||
shell=True,
|
||||
stdin=None, stdout=f, stderr=f,
|
||||
executable="/bin/bash")
|
||||
proc.wait()
|
||||
output, error_output = proc.communicate()
|
||||
# Check what is error in error_output
|
||||
if "NO_PUBKEY" in str(error_output):
|
||||
# Split the output
|
||||
@@ -38,10 +47,11 @@ class WOAptGet():
|
||||
WORepo.add_key(
|
||||
self, key, keyserver="hkp://pgp.mit.edu")
|
||||
|
||||
proc = subprocess.Popen('apt-get update',
|
||||
shell=True,
|
||||
stdin=None, stdout=f, stderr=f,
|
||||
executable="/bin/bash")
|
||||
proc = subprocess.Popen(
|
||||
'DEBIAN_FRONTEND=noninteractive apt-get update -qq',
|
||||
shell=True,
|
||||
stdin=None, stdout=f, stderr=f,
|
||||
executable="/bin/bash")
|
||||
proc.wait()
|
||||
|
||||
if proc.returncode == 0:
|
||||
@@ -84,11 +94,11 @@ class WOAptGet():
|
||||
with open('/var/log/wo/wordops.log', 'a') as f:
|
||||
proc = subprocess.Popen(
|
||||
"DEBIAN_FRONTEND=noninteractive "
|
||||
"apt-get dist-upgrade "
|
||||
"apt-get "
|
||||
"--option=Dpkg::options::=--force-confdef "
|
||||
"--option=Dpkg::options::=--force-unsafe-io "
|
||||
"--option=Dpkg::options::=--force-confold "
|
||||
"--assume-yes --quiet ",
|
||||
"--assume-yes --quiet dist-upgrade",
|
||||
shell=True, stdin=None,
|
||||
stdout=f, stderr=f,
|
||||
executable="/bin/bash")
|
||||
@@ -111,17 +121,15 @@ class WOAptGet():
|
||||
all_packages = ' '.join(packages)
|
||||
try:
|
||||
with open('/var/log/wo/wordops.log', 'a') as f:
|
||||
proc = subprocess.Popen("DEBIAN_FRONTEND=noninteractive "
|
||||
"apt-get install "
|
||||
"--option=Dpkg::options::="
|
||||
"--force-confdef "
|
||||
"--option=Dpkg::options::="
|
||||
"--force-confold "
|
||||
"--assume-yes "
|
||||
"--allow-unauthenticated {0}"
|
||||
.format(all_packages), shell=True,
|
||||
stdin=None, stdout=f, stderr=f,
|
||||
executable="/bin/bash")
|
||||
proc = subprocess.Popen(
|
||||
"DEBIAN_FRONTEND=noninteractive "
|
||||
"apt-get install "
|
||||
"--option=Dpkg::options::=--force-confdef "
|
||||
"--option=Dpkg::options::=--force-confold "
|
||||
"--assume-yes --allow-unauthenticated {0}"
|
||||
.format(all_packages), shell=True,
|
||||
stdin=None, stdout=f, stderr=f,
|
||||
executable="/bin/bash")
|
||||
proc.wait()
|
||||
|
||||
if proc.returncode == 0:
|
||||
|
||||
Reference in New Issue
Block a user