Install unattended updates on Ubuntu

Update the system and install packages

apt-get update && apt-get install unattended-upgrades

Configure unattended upgrades

dpkg-reconfigure -plow unattended-upgrades

Replacing config file /etc/apt/apt.conf.d/20auto-upgrades with new version
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults

Configuration

vi /etc/apt/apt.conf.d/50unattended-upgrades
Unattended-Upgrade::Allowed-Origins {
        "${distro_id}:${distro_codename}";
        "${distro_id}:${distro_codename}-security";
        // Extended Security Maintenance; doesn't necessarily exist for
        // every release and this system may not have it installed, but if
        // available, the policy for updates is such that unattended-upgrades
        // should also install from here by default.
        "${distro_id}ESM:${distro_codename}";
        "${distro_id}:${distro_codename}-updates";
//      "${distro_id}:${distro_codename}-proposed";
//      "${distro_id}:${distro_codename}-backports";
};