I have an unattended script for installing servers. At the beginning of the script there is a sudo apt-get dist-upgrade --yes
.
The dist upgrade has a nasty user input screen at its end asking to restart services:
![enter image description here](https://i.stack.imgur.com/xVCIt.png)
Is it possible to autoaccept service restarts or disable this screen? It breaks my whole script. Also Im afraid it might leave my server stuck at some point when updating...
same result with apt-get upgrade
edit:
I tried without success:
#!/bin/bash
sudo apt-get update
sudo apt-get remove apt-listchanges --assume-yes --force-yes &&
#using export is important since some of the commands in the script will fire in a subshell
export DEBIAN_FRONTEND=noninteractive &&
export APT_LISTCHANGES_FRONTEND=none &&
#lib6c was an issue for me as it ignored the DEBIAN_FRONTEND environment variable and fired a prompt anyway. This should fix it
echo 'libc6 libraries/restart-without-asking boolean true' | debconf-set-selections &&
echo "executing wheezy to jessie" &&
find /etc/apt -name "*.list" | xargs sed -i '/^deb/s/wheezy/jessie/g' &&
echo "executing autoremove" &&
sudo apt-get -fuy --force-yes autoremove &&
echo "executing clean" &&
sudo apt-get --force-yes clean &&
echo "executing update" &&
sudo apt-get update &&
echo "executing upgrade" &&
sudo apt-get --force-yes -o Dpkg::Options::="--force-confold" --force-yes -o Dpkg::Options::="--force-confdef" -fuyq upgrade &&
echo "executing dist-upgrade" &&
sudo apt-get --force-yes -o Dpkg::Options::="--force-confold" --force-yes -o Dpkg::Options::="--force-confdef" -fuyq dist-upgrade