only run apt update if necessary

This commit is contained in:
Matthias Wirth
2022-01-29 23:44:14 +01:00
parent 9a69fec17c
commit 767803f104

View File

@@ -46,8 +46,10 @@ if [[ -n "${packages[*]}" ]]; then
exit 1
fi
echo "Installing required packages: ${packages[*]}"
apt-get update || true
apt-get install -y --no-install-suggests --no-install-recommends "${packages[@]}" || true
if ! apt-get install -y --no-install-suggests --no-install-recommends "${packages[@]}"; then
apt-get update || true
apt-get install -y --no-install-suggests --no-install-recommends "${packages[@]}" || true
fi
hash -r || true
while read -r -d '/' CMD PKG
do