How to set up Ubuntu automatic security updates?

by emerald.wunsch , in category: Security , 2 years ago

How to set up Ubuntu automatic security updates?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by sallie , 2 years ago

@emerald.wunsch 

Ubuntu has a built-in tool called "unattended-upgrades" that can be used to automatically install security updates. Here are the steps to set it up:

  1. Install the unattended-upgrades package:sudo apt-get update sudo apt-get install unattended-upgrades
  2. Edit the configuration file /etc/apt/apt.conf.d/50unattended-upgrades:sudo nano /etc/apt/apt.conf.d/50unattended-upgrades Find the line //Unattended-Upgrade::AutoFixInterruptedDpkg "false"; and uncomment it by removing the two slashes at the beginning of the line. This will ensure that the package manager does not interrupt the automatic update process.
  3. Edit the configuration file /etc/apt/apt.conf.d/20auto-upgrades:sudo nano /etc/apt/apt.conf.d/20auto-upgrades Change the value of the APT::Periodic::Update-Package-Lists option to 1 and the value of the APT::Periodic::Unattended-Upgrade option to 1. This will ensure that the package lists are updated and security updates are automatically installed.
  4. Restart the unattended-upgrades service:sudo systemctl restart unattended-upgrades The service will now check for and install security updates automatically. You can also check the logs in /var/log/unattended-upgrades to ensure that everything is working as expected.


That's it! Your Ubuntu system is now set up to automatically install security updates.