Even though womble's answer above is generally good, it did not work for me and I had to do some additional research to go 100% unattended. I thought I'll share the result in a concise manner to make things simpler for future visitors.
The following is a script that will run according to the debian 8 release notes upgrade recommendations (mostly) along with flags and environment variables that will make it unattended. (the echo
s are just for debugging and could be removed - though I recommend keeping them so if the script gets stuck you will know where)
#!/bin/bash
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" &&
apt-get -fuy --force-yes autoremove &&
echo "executing clean" &&
apt-get --force-yes clean &&
echo "executing update" &&
apt-get update &&
echo "executing upgrade" &&
apt-get --force-yes -o Dpkg::Options::="--force-confold" --force-yes -o Dpkg::Options::="--force-confdef" -fuy upgrade &&
echo "executing dist-upgrade" &&
apt-get --force-yes -o Dpkg::Options::="--force-confold" --force-yes -o Dpkg::Options::="--force-confdef" -fuy dist-upgrade