Unattended Upgrades on Debian, Ubuntu and similar distros This note was created on 2023-03-20 This note was last edited on 2023-03-20 1. Install required packages: # apt install unattended-upgrades apt-listchanges 2. Configure unattended-upgrades: # 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: # 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: # unattended-upgrades --dry-run --debug $ cat /var/log/unattended-upgrades/unattended-upgrades.log