Debian automatic updates

From Levy

Debian makes use of the unattended-upgrades package in order to enable automatic updates.

# apt install unattended-upgrades

If it doesn't already exist, create a file /etc/apt/apt.conf.d/20auto-upgrades with the following content:

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

Now enable the repository from which updates can be installed in /etc/apt/apt.conf.d/50unattended-upgrades; in our case, only the security repository:

Unattended-Upgrade::Origins-Pattern {
   "origin=Debian,codename=${distro_codename},label=Debian-Security";
};

Finally restart the unattended upgrade service:

systemctl status unattended-upgrades