Configure Ubuntu Auto Upgrade in terminal

  • Install dependencies
  •         sudo apt install unattended-upgrades
          
  • Edit /etc/apt/apt.conf.d/50unattended-upgrades and change the following:
  •         # Enable this setting in Unattended-Upgrade::Allowed-Origins
            "${distro_id}:${distro_codename}-updates";
          
  • To keep /boot folder small
  •         Unattended-Upgrade::Remove-Unused-Kernel-Packages "true";
            Unattended-Upgrade::Remove-Unused-Dependencies "true";
          
  • Optional:
  •         # Replace email address with administrator address and insure that email can be sent from cli
            Unattended-Upgrade::Mail "you@some.site";
    
            # Enable auto reboot
            Unattended-Upgrade::Automatic-Reboot "true";
            Unattended-Upgrade::Automatic-Reboot-Time "02:38";
            # For non-critical servers, add this:
            Unattended-Upgrade::Automatic-Reboot-WithUsers "true";
          
  • Edit /etc/apt/apt.conf.d/20auto-upgrades and change the following:
  •         # Some of these settings may already be active
            APT::Periodic::Update-Package-Lists "1";
            APT::Periodic::Download-Upgradeable-Packages "1";
            APT::Periodic::AutocleanInterval "7";
            APT::Periodic::Unattended-Upgrade "1";
          
  • Check if it works:
  •         sudo unattended-upgrades --dry-run --debug
          

References


Nexti SA PTY LTD
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.