Ubuntu – unattended-upgrades vs cron-apt on a server

unattended-upgrades

What are the advantages of unattended-updates over cron-apt and vice versa?

Basically I want a fully automatic upgrade process in the night:

  • install all updates (even non-security)
  • reboot if necessary
  • it would be good also to trigger a scheduled maintenance in our icinga on before reboots

Best Answer

cron-apt

Cron-apt only downloads new packages by default. This can be useful if you have a strongly customized system. (for more details, see source [1])

unattended-upgrades

apt includes support for running an unattended upgrade script; Ubuntu includes this with the ''unattended-upgrade'' package which handles both security and non-security updates. The frequency of updates can be changed by setting the variable APT::Periodic::Unattended-Upgrade "x"; where x is the number of days.

This is the recommended way to do unattended upgrades in Ubuntu:

sudo apt-get install unattended-upgrades
dpkg-reconfigure -plow unattended-upgrades

(-plow is the short form of --priority=low. That is, show all questions of 'low' priority or higher.)

Automatic upgrades can break your system, so be aware, that you should only install this on systems where a failiure is not fatal to any means.

[1] Source: https://help.ubuntu.com/community/AutoWeeklyUpdateHowTo