How to Setup and Enable Automatic Security Updates on Ubuntu/Debian

Introduction

You risk overall security if you fail to keep your Ubuntu/Debian operating system packages up-to-date. Malicious actors can exploit security flaws in outdated packages. Keeping your packages up-to-date helps to protect you from these attacks. Additionally, updates often include bug fixes and other minor improvements that can help keep your system running smoothly. Fortunately, there is an alternative - automatic updates. 

With automated updates enabled, your system will be updated with the latest security patches and bug fixes as soon as they're released. This will keep your system secure and running smoothly, without having to manually check for updates. This tutorial explains how to enable automatic security updates in Ubuntu and Debian.

Step-to-step guide to make automatic updates for Ubuntu/Debian

Step 1. You can install the upgrade by running the following command.

sudo apt update && sudo apt upgrade

Step 2. To install automatic updates enter the following command:

sudo apt install unattended-upgrades apt-listchanges bsd-mailx

Step 3. Enable automatic security updates by running:

sudo dpkg-reconfigure -plow unattended-upgrades

Step 4. Set up automatic updates:

sudo nano /etc/apt/apt.conf.d/50unattended-upgrades

Step 5. Uncomment and correct the lines.
Email Alert ID :

Unattended-Upgrade::Mail "mail@domain.com";

Step 6. Email alerts only if the update fails:

Unattended-Upgrade::MailOnlyOnError "true";

Step 7. Automatically reboot without confirming kernel updates, uncomment the line:

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

Step 8.  Set the email ID:

sudo nano /etc/apt/listchanges.conf

Step 9. Save and close the file.

Step 10. Make sure it works by running the following command:

sudo unattended-upgrades --dry-run

Conclusion

Follow this guide to install, configure, and enable automatic security updates on Ubuntu/Debian. This guide will fully automate the entire process of protecting your system from the latest security threats. With automatic security updates, you can have peace of mind knowing that your system is constantly updated with the latest security patches, reducing the risk of vulnerabilities and potential attacks. Maintaining the integrity of your system is made easier by implementing automatic security updates.

How useful was this article?

VAT

  • Other

    Other

    0%
  • austria

    Austria

    20%
  • Belgium

    Belgium

    21%
  • Bulgaria

    Bulgaria

    20%
  • Croatia

    Croatia

    25%
  • Cyprus

    Cyprus

    19%
  • Czech Republic

    Czech Republic

    21%
  • Denmark

    Denmark

    25%
  • Estonia

    Estonia

    22%
  • France

    France

    20%
  • Finland

    Finland

    24%
  • Germany

    Germany

    19%
  • Greece

    Greece

    24%
  • Hungary

    Hungary

    27%
  • Ireland

    Ireland

    23%
  • Italy

    Italy

    22%
  • Latvia

    Latvia

    21%
  • Lithuania

    Lithuania

    21%
  • Luxembourg

    Luxembourg

    17%
  • Malta

    Malta

    18%
  • Netherlands

    Netherlands

    21%
  • Poland

    Poland

    23%
  • Portugal

    Portugal

    23%
  • Romania

    Romania

    19%
  • Slovakia

    Slovakia

    20%
  • Slovenia

    Slovenia

    %
  • Spain

    Spain

    21%
  • Sweden

    Sweden

    25%
  • USA

    USA

    0%
european
states
  • Other
  • canada
  • poland
  • european-union
  • france
  • germany
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria