From 193510cd901748f85c3d093ce3c93b16a73d1d3d Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Sun, 16 Jun 2024 08:07:19 +0530 Subject: [PATCH] Link apt-fast to apt-get if missing --- src/scripts/linux.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/scripts/linux.sh b/src/scripts/linux.sh index 33ef3a2f7..43c9ca1ed 100644 --- a/src/scripts/linux.sh +++ b/src/scripts/linux.sh @@ -6,6 +6,14 @@ add_sudo() { fi } +# Function to link apt-fast to apt-get +link_apt_fast() { + if ! command -v apt-fast >/dev/null; then + sudo ln -sf /usr/bin/apt-get /usr/bin/apt-fast + trap "sudo rm -f /usr/bin/apt-fast 2>/dev/null" exit + fi +} + # Function to setup environment for self-hosted runners. self_hosted_helper() { if ! command -v apt-fast >/dev/null; then @@ -289,6 +297,7 @@ apt_install="sudo $debconf_fix apt-fast install -y --no-install-recommends" scripts="$src"/scripts add_sudo >/dev/null 2>&1 +link_apt_fast >/dev/null 2>&1 . /etc/os-release # shellcheck source=.