Skip to content

Commit

Permalink
Move to apt-fast if available on Debian and derivates
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffmcjunkin authored Feb 13, 2024
1 parent f87dfa8 commit 3f7a968
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/platforms/debian.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ def base_install_modules(module_name):
# depends
if counter == 1:
for module in modules:
command = ("apt-get -q --allow-downgrades --allow-remove-essential --allow-change-held-packages -y install " + module)
# Check if `apt-fast` is available, otherwise use apt-get
if subprocess.Popen("which apt-fast >/dev/null", shell=True).wait() == 0:
command = ("apt-fast -y install " + module)
else:
command = ("apt-get -q --allow-downgrades --allow-remove-essential --allow-change-held-packages -y install " + module)
subprocess.Popen("export DEBIAN_FRONTEND=noninteractive;%s" %
command, shell=True).wait()
command, shell=True).wait()
else:
command = ("apt-get -q --allow-downgrades --allow-remove-essential --allow-change-held-packages -y install " + modules)
subprocess.Popen("export DEBIAN_FRONTEND=noninteractive;%s" %
Expand Down

0 comments on commit 3f7a968

Please sign in to comment.