Rerun apt-get if it failed

We often get errors due to repositories being updated, so retry running
apt when this happens to see if it helps.
This commit is contained in:
Vadim Zeitlin
2026-01-14 23:36:12 +01:00
parent a6bc44cb15
commit 9c21322c01

View File

@@ -96,12 +96,16 @@ tmstamp()
echo -n "[$(date '+%H:%M:%S')]" ;
}
# Disable some (but not all) output.
SOCI_APT_OPTIONS='-q -y -o=Dpkg::Use-Pty=0 --no-install-recommends'
run_apt()
{
# Disable some (but not all) output.
sudo apt-get $SOCI_APT_OPTIONS "$@"
if ! sudo apt-get $SOCI_APT_OPTIONS "$@"; then
echo "apt-get "$@" failed, retrying once just in case it was spurious..."
sleep 30
sudo apt-get $SOCI_APT_OPTIONS "$@"
fi
}
run_make()