Automatic upgrades in Debian

First we install the required packages. As root do:

apt-get install unattended-upgrades

Create the file: /etc/apt/apt.conf.d/20auto-upgrades and add the following content to it:

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";

Replace the file /etc/apt/apt.conf.d/50unattended-upgrades and add the following to …

more ...