From 3f7a968d9e3b7d9569a0b0e27221935ea7f91a02 Mon Sep 17 00:00:00 2001 From: Jeff McJunkin Date: Tue, 13 Feb 2024 13:39:35 -0800 Subject: [PATCH] Move to apt-fast if available on Debian and derivates --- src/platforms/debian.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/platforms/debian.py b/src/platforms/debian.py index de956e54..23afb6a3 100644 --- a/src/platforms/debian.py +++ b/src/platforms/debian.py @@ -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" %