Linux

Ubuntu Enable & Setup Automatic Unattended Security Updates

[ad_1]

I have minimal Ubuntu Linux 18.04 LTS server setup in the cloud. I read that one can configure Ubuntu Linux to download and install security updates when released automatically. How can I set up automatic security updates on Ubuntu Linux 18.04 or 16.04 LTS system?

Introduction: It is true that the Linux server security is an essential task for sysadmins. One of the most fundamental ways to keep server or desktop secure is by installing security updates to patch vulnerabilities on time. One can use the apt-get command or apt command to install security updates. This page shows you how to configure Ubuntu Linux system to install security updates automatically when released by Ubuntu security team.

Ubuntu Enable & Setup Automatic Unattended Security Updates

You may be wondering why do I need an unattended way and installs security updates? Applying updates on a frequent basis is an important part of keeping systems secure. By default, updates need to be applied manually using package management tools. However, you can choose to have Ubuntu automatically download and install important security updates.

Step 1. Install unattended-upgrades package

Warning: Some security risks associated with running unattended software upgrades without supervision do exists, but there are also benefits. Use your judgment when in doubt.

Type the following apt-get command or apt command to install unattended-upgrades package:
$ sudo apt install unattended-upgrades apt-listchanges bsd-mailx
Ubuntu Enable & Setup Automatic Unattended Security Updates

Step 2. Ubuntu enable unattended security updates

Run the following command:
$ sudo dpkg-reconfigure -plow unattended-upgrades
Ubuntu enable automatic updates
You should see /etc/apt/apt.conf.d/20auto-upgrades file created due to above command. One can view the same with cat command:
$ cat /etc/apt/apt.conf.d/20auto-upgrades
Sample outputs (make sure it is as follows; if NOT update it manually):

Step 3. Configuration file

You need to edit the file named /etc/apt/apt.conf.d/50unattended-upgrades using a text editor such as vim command or nano command:
$ sudo vi /etc/apt/apt.conf.d/50unattended-upgrades
Make sure config is as follows:

One can skip packages to not update (optional):

You need to configure an email address to get email when there is a problem or package upgrades. Of course you must have working email setup to this work:

Save and close the file. Finally edit the file named /etc/apt/listchanges.conf using a text editor such as vim command/nano command:
$ sudo vi /etc/apt/listchanges.conf
Set email address from:
email_address=root
To:
[email protected]
Save and close the file.

Conclusion

You learned how to install and configure the unattended-upgrades package to automatically install updated packages, and can be configured to update all packages or install security updates. For more info see this page.

 

[ad_2]

Facebook Comments

Show More

Related Articles

Leave a Reply

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

Back to top button