Ubuntu — Automatic Security Updates

In the Linux world, updates can come out quite often. When managing multiple servers, keeping them all up to date can be a hassle to say the least. This quick post will show you how you can automate the process of installing security updates on your Ubuntu server.

Important: Rarely is it a good idea for you to enable auto updates on a production server. All updates should first be tested in a staging area to make sure they don’t cause problems with your environment.

1. Install unattended-upgrades

2. Enable unattended upgrades

Select “yes” to enable upgrades

3. Configure unattended-upgrades

Find the following line and uncomment it if it’s commented:

If you would also like to install all other updates (not just security updates) then uncomment the next line that looks like:

Bonus – Receive an email report after updates

Install mailutils if it’s not already installed:

A wizard will start that will help you configure mailutils. The default settings should be fine for 99% of cases.

Go back to the 50unattended-upgrades conf file

Find the Unattended-Upgrade::Mail option. Uncommment it, and add one or more email addresses separated by commas.

Now you will receive an email after each update that details which packages were updated, if a reboot is needed, and more.

Leave a Reply

Your email address will not be published. Required fields are marked *