}
if is_ubuntu; then
+ # Use netselect to choose a package mirror to install python-minimal in a
+ # reliable manner.
+ # apt{-get} does not refresh the package mirrors (for packer builds run
+ # within Jenkins), therefore fails with "E: Unable to locate package
+ # python-minimal" while installing python-minimal.
+ echo "Install netselect to choose a mirror."
+ apt install wget -y
+ wget http://ftp.au.debian.org/debian/pool/main/n/netselect/netselect_0.3.ds1-26_amd64.deb
+ dpkg -i netselect_0.3.ds1-26_amd64.deb
+ netselect -s 20 -t 40 "$(wget -qO - mirrors.ubuntu.com/mirrors.txt)"
+ sed -i 's/http:\/\/us.archive.ubuntu.com\/ubuntu\//http:\/\/ubuntu.uberglobalmirror.com\/archive\//' /etc/apt/sources.list
+
echo "Installing python-minimal..."
+ apt clean all -y
apt -y update
apt install -y python-minimal
fi
--- /dev/null
+---
+fixes:
+ - |
+ Use netselect to choose a package mirror to install python-minimal in a
+ reliable manner.
+
+ apt{-get} does not refresh the package mirrors (for packer builds run
+ within Jenkins), therefore fails with "E: Unable to locate package
+ python-minimal" while installing python-minimal.