How to get Debian to download and auto-update servers
You want to use a combination of these commands at different times:
apt-get -qq update # necessary, no email desired apt-get -dy upgrade # download minor updates, do not install, send email apt-get -y upgrade # install minor updates, send email apt-get -qqdy dist-upgrade # download major updates, do not install, no email apt-get -dy dist-upgrade # download major updates, do not install, send email apt-get -y dist-upgrade # install major updates, send email
This is what I do:
apt-get -qq update && apt-get -qqdy dist-upgrade && apt-get -dy upgrade
apt-get -y upgrade && apt-get -dy dist-upgrade
apt-get -y dist-upgrade
- The daily cron job does not install anything and does not send email. It just loads the cache with everything (-qqdy dist-upgrade) and sends email about security updates (-dy upgrade).
- The weekly job installs upgrades and sends email about what it did, and also about which dist-upgrade packages it has downloaded (but not installed).
- The monthly job does a dist-upgrade (I'm ok with this) and sends email.
This approach is easy to tweak. What is important is that you can choose to download and send email and *not* install; this gives you a notice about what is available but requires you to manually log in and install them.