From 91c1e8313f44e94e594befe094c687fdbca010af Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 6 Sep 2016 14:33:13 +0200 Subject: [PATCH] buildserver: download apt package first to increase reliability This does not have the careful result rechecking that chef has, when it installs each package in the list one at a time. So to help with failures caused by a package failing to download, first try downloading all the package, then run the install. The install pass will try to download any missing packages. Really, this should use ansible or perhaps chef again since those include lots of tricks around this stuff. --- buildserver/provision-apt-get-install | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/buildserver/provision-apt-get-install b/buildserver/provision-apt-get-install index deeb0c66..09909050 100644 --- a/buildserver/provision-apt-get-install +++ b/buildserver/provision-apt-get-install @@ -8,6 +8,9 @@ debian_mirror=$1 sed -i "s,http://ftp.uk.debian.org/debian/,${debian_mirror},g" /etc/apt/sources.list +printf 'APT::Install-Recommends "0";\nAPT::Install-Suggests "0";\n' \ + > /etc/apt/apt.conf.d/99no-install-recommends + if grep --quiet jessie /etc/apt/sources.list; then echo "deb $debian_mirror jessie-backports main" > /etc/apt/sources.list.d/backports.list fi @@ -15,6 +18,7 @@ fi dpkg --add-architecture i386 apt-get -y update +apt-get -y upgrade --download-only apt-get -y upgrade packages=" @@ -87,8 +91,8 @@ packages=" zip zlib1g:i386 " - -apt-get install --yes --no-install-recommends $packages +apt-get install --yes $packages --download-only +apt-get install --yes $packages highestjava=`update-java-alternatives --list | sort -n | tail -1 | cut -d ' ' -f 1` update-java-alternatives --set $highestjava