diff --git a/src/scripts/linux.sh b/src/scripts/linux.sh index 85a3334f..a0bd3c15 100644 --- a/src/scripts/linux.sh +++ b/src/scripts/linux.sh @@ -15,10 +15,15 @@ self_hosted_helper() { install_packages apt-transport-https ca-certificates curl file make jq unzip autoconf automake gcc g++ gnupg } +# Function to fix broken packages. +fix_broken_packages() { + sudo apt --fix-broken install >/dev/null 2>&1 +} + # Function to install a package install_packages() { packages=("$@") - $apt_install "${packages[@]}" >/dev/null 2>&1 || (update_lists && $apt_install "${packages[@]}" >/dev/null 2>&1) + $apt_install "${packages[@]}" >/dev/null 2>&1 || (update_lists && fix_broken_packages && $apt_install "${packages[@]}" >/dev/null 2>&1) } # Function to disable an extension.