Unattended Upgrades on Debian, Ubuntu and similar distros This note was created on 3/20/2023 This note was last edited on 3/20/2023 1. Install required packages: > sudo apt install unattended-upgrades apt-listchanges 2. Configure unattended-upgrades: > sudo nano /etc/apt/apt.conf.d/50unattended-upgrades Uncomment: ~~~ "${distro_id}:${distro_codename}-updates"; Unattended-Upgrade::Mail "root"; ~~~ Change: ~~~ Unattended-Upgrade::Remove-Unused-Kernel-Packages "true"; Unattended-Upgrade::Remove-Unused-Dependencies "true"; Unattended-Upgrade::Automatic-Reboot "true"; Unattended-Upgrade::Automatic-Reboot-Time "02:00"; ~~~ 3. Enable automatic updates: > sudo nano /etc/apt/apt.conf.d/20auto-upgrades In most cases, the file will be empty. Copy and paste the following lines: ~~~ APT::Periodic::Update-Package-Lists "1"; APT::Periodic::Download-Upgradeable-Packages "1"; APT::Periodic::AutocleanInterval "7"; APT::Periodic::Unattended-Upgrade "1"; // Send report mail to root //APT::Periodic::Verbose "2"; ~~~ 4. Check configuration: > sudo unattended-upgrades --dry-run --debug > cat /var/log/unattended-upgrades/unattended-upgrades.log