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.
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
dpkg --add-architecture i386
apt-get -y update
+apt-get -y upgrade --download-only
apt-get -y upgrade
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