#!/bin/sh -e printf 'MINI_BUILDD: %s: %s\n' apt-update 'Update APT'; for N in 10 40 80 160 320; do if timeout ${N}s apt-get --quiet --yes --option=APT::Install-Recommends=false --option=Acquire::Languages=none --option=Dpkg::Use-Pty=false --option=Dpkg::Options::=--force-confdef --option=Dpkg::Options::=--force-confnew update; then apt-cache policy exit 0 fi printf "W: apt-update: Did not succeed after %s seconds (retrying) " "${N}" >&2 sleep 10 done exit 1