From: Ward Vandewege Date: Thu, 28 Apr 2022 15:15:44 +0000 (-0400) Subject: Add a 2 minute lock timeout to the first invocation of apt. This is X-Git-Tag: 2.5.0~187^2~2 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/f959aac33c7f09df2975a81b8a1cd1eeeb38af6f Add a 2 minute lock timeout to the first invocation of apt. This is supported from apt 1.9.1 (i.e Debian 11, ubuntu 20.04 and up). It avoids race conditions, e.g. caused by cloud-init running apt on a node that has just booted. No issue # Arvados-DCO-1.1-Signed-off-by: Ward Vandewege --- diff --git a/tools/salt-install/provision.sh b/tools/salt-install/provision.sh index c9e535fad2..be1506c620 100755 --- a/tools/salt-install/provision.sh +++ b/tools/salt-install/provision.sh @@ -302,7 +302,10 @@ else yum install -y curl git jq ;; "debian"|"ubuntu") - DEBIAN_FRONTEND=noninteractive apt update + # Wait 2 minutes for any apt locks to clear + # This option is supported from apt 1.9.1 and ignored in older apt versions. + # Cf. https://blog.sinjakli.co.uk/2021/10/25/waiting-for-apt-locks-without-the-hacky-bash-scripts/ + DEBIAN_FRONTEND=noninteractive apt -o DPkg::Lock::Timeout=120 update DEBIAN_FRONTEND=noninteractive apt install -y curl git jq ;; esac