sudo apt update && sudo apt upgrade
cd /etc/apt/apt.conf.d
sudo apt install unattended-upgrades apt-listchanges
# TO ENABLE AUTOMATIC RESTART
sudo apt install apt-config-auto-update

sudo vi /etc/apt/apt.conf.d/50unattended-upgrades
# UNCOMMENT
        "origin=Debian,codename=${distro_codename}-updates";
        "origin=Debian,codename=${distro_codename}-proposed-updates";
        "origin=Debian,codename=${distro_codename},label=Debian";
        "origin=Debian,codename=${distro_codename},label=Debian-Security";
        "origin=Debian,codename=${distro_codename}-security,label=Debian-Security";


Unattended-Upgrade::MailReport "on-change";
Unattended-Upgrade::Mail "support@mywebsite.com";
Unattended-Upgrade::Automatic-Reboot "false";
Unattended-Upgrade::Automatic-Reboot-WithUsers "true";

sudo dpkg-reconfigure --priority=low unattended-upgrades

sudo systemctl enable unattended-upgrades
sudo systemctl status unattended-upgrades

