Before the updates we get sudo rights and ask for the password to ensure that the processes that follow runs smoothly. Without this some package managers throw up errors when trying to install packages.
# Ask for the password up-front
# Keep-alive: update existing sudo time stamp if set, otherwise do nothing.
while true; do sudo -n true; sleep 60; kill -0 "$" || exit; done 2>/dev/null &