How do I configure automatic unattended updates for Ubuntu Linux 20.04 LTS “Focal Fossa” server?

The Linux server security is indeed an essential task for sysadmins. One of the most fundamental ways to keep the Ubuntu server secure is by installing security updates on time to patch vulnerabilities. By default, the unattended-upgrades package installed, but you still need to configure a few options. It will automatically install software updates, including security updates. This page shows how to configure security updates automatically  when released by the Ubuntu security team using an unattended-upgrades package.


Automatic unattended updates for Ubuntu 20.04 LTS

  1. Update the Ubuntu 20.04 LTS server for security patches, run:

  2. [admin@aws-ec2-007]$ ``sudo apt update && sudo apt upgrade

  3. Install unattended upgrades on Ubuntu if not installed. Type the following apt command

  4. [admin@aws-ec2-007]$ ``sudo apt install unattended-upgrades apt-listchanges bsd-mailx

  5. Turn on unattended security updates, run:

  6. [admin@aws-ec2-007]$ ``sudo dpkg-reconfigure -plow unattended-upgrades

  7. How To set up automatic unattended updates for Ubuntu 20.04 Linux

  8. Configure automatic unattended updates, enter:

  9. [admin@aws-ec2-007]$ ``sudo vi /etc/apt/apt.conf.d/50unattended-upgrades

  10. Set up alert email ID:

  11. Unattended-Upgrade::Mail "";

  12. Automatically reboot Ubuntu box WITHOUT CONFIRMATION for kernel updates:

  13. Unattended-Upgrade::Automatic-Reboot "true";

  14. Finally edit the /etc/apt/listchanges.conf and set email ID:


  16. Save and close the file.It would be best if you have a working email server to get an alert. You can always use AWS SES with Postfix MTA to route email safely.

  17. Verify that it is working by running the following command:

  18. [admin@aws-ec2-007]$ ``sudo unattended-upgrades --dry-run

  19. How to Enable and Set up Automatic Unattended Security Updates on Ubuntu

#[object object] #[object object] #[object object] #[object object] #[object object] #ubuntu

Set up automatic unattended updates for Ubuntu 20.04
29.50 GEEK