To avoid any prompts from Debian packages like Grub or mySQL, you can temporarily set an environment variable. This ideal for provisioning scripts in Containers like Vagrant/Docker.
export DEBIAN_FRONTEND="noninteractive"
Also make sure to auto confirm apt with the -y parameter
apt -y upgrade