Skip to content

Configure Unattended Security Updates on Ubuntu

By Patrick Domingues2 min read
Ubuntu 22.04 Tutorials

Configure unattended upgrades on Ubuntu by inspecting the existing policy, testing package selection and planning restart behavior. Security updates and all-package upgrades are different maintenance choices.

Inspect the existing update policy

Ubuntu can already have automatic security updates enabled. Check the installed package, effective APT settings and timers before overwriting configuration. Record which repositories are permitted and whether a management system owns those files.

apt-cache policy unattended-upgrades
apt-config dump
systemctl list-timers 'apt-*'

Use Ubuntu’s automatic-update documentation for your release. Repository origins determine which updates qualify; enabling all regular updates is a different decision from automatically applying security fixes.

Enable and review deliberately

If required, install the package through an approved maintenance process:

sudo apt-get update
sudo apt-get install unattended-upgrades
sudo dpkg-reconfigure -plow unattended-upgrades

Review the resulting configuration under /etc/apt/apt.conf.d/ and preserve local policy. Do not assume a search-and-replace command matched the release’s configuration comments. Keep a backup of any file edited and make only the intended changes.

Dry-run before trusting automation

sudo unattended-upgrade --dry-run --debug

Inspect the allowed origins and proposed packages. A dry run validates selection without proving that every future update will install. Review unattended-upgrade logs and failed service/timer runs after actual maintenance. Configure and test a notification path rather than assuming an email address alone makes delivery work.

Plan restarts and application checks

Automatic restart is an availability decision, not a required default. The earlier script enabled reboot behavior through text substitutions; this guide leaves that choice to the workload’s maintenance plan. Confirm service restarts, sessions and any cluster coordination before enabling automatic reboots.

After real updates, check whether a reboot is required and verify the hosted applications. Retain monitoring for stalled packages and security fixes that require an action beyond normal package installation. Automatic updating reduces routine work but still needs observation and recovery planning.

Practical checks and next steps

Review the first actual update run and failed package actions. A timer being enabled is not evidence that updates completed or that a required restart occurred.

Explore Linux & Ubuntu for related guides.

Reference 1 Reference 2

Content review: November 24, 2026. Reviewed the stated scope, guidance and source references; tenant, hardware and production changes were not executed as part of this editorial review. Original publication date retained.

Patrick Domingues, arms crossed

Patrick Domingues

Practical cybersecurity insights, IT tutorials, and tools for the systems you manage every day.

Leave a Reply

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