Skip to content

Instantly share code, notes, and snippets.

@portableant
Created May 16, 2019 22:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save portableant/ba96623407b61f435ffe789952a60708 to your computer and use it in GitHub Desktop.
Save portableant/ba96623407b61f435ffe789952a60708 to your computer and use it in GitHub Desktop.
Unattended Ubuntu upgrade set up
sudo su -
apt install unattended-upgrades
nano /etc/apt/apt.conf.d/50unattended-upgrades
Uncomment or change to the below:
"${distro_id}:${distro_codename}-updates";
Unattended-Upgrade::Mail "itoffice@fitzmuseum.cam.ac.uk";
Unattended-Upgrade::MailOnlyOnError "true";
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";
Ctrl + x and save file
nano /etc/apt/apt.conf.d/20auto-upgrades
Add:
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::Unattended-Upgrade "1";
ctrl + x and save file
Check it works
unattended-upgrades --dry-run --debug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment