Security fixes can pile up between maintenance sessions on Ubuntu Server 26.04 LTS, where unattended upgrades can install them on a schedule.
APT refreshes its package lists and checks for unattended upgrades on separate timers. Ubuntu's standard origin policy allows its release and security pockets. The regular -updates pocket remains available for manual upgrades.
Expanded Security Maintenance (ESM) extends security coverage for packages on eligible Ubuntu Pro systems. Ubuntu includes both ESM security pockets in its default policy.
Steps to enable automatic security updates on Ubuntu:
Use an SSH session or the server console on Ubuntu 26.04 LTS with an account that can use sudo. Start with unattended-upgrades installed, its default origins in place, APT's periodic upgrades turned off, and the standard apt-daily.timer package-list timer enabled at boot and active now. The apt-daily-upgrade.timer upgrade timer must report disabled with systemctl is-enabled and inactive with systemctl is-active.
- Inspect the effective APT policy before turning on scheduled upgrades.
$ apt-config dump | grep -Ei '^(APT::Periodic::|Unattended-Upgrade::(Allowed-Origins|Origins-Pattern|Automatic-Reboot))' ##### snipped ##### Unattended-Upgrade::Allowed-Origins ""; Unattended-Upgrade::Allowed-Origins:: "${distro_id}:${distro_codename}"; Unattended-Upgrade::Allowed-Origins:: "${distro_id}:${distro_codename}-security"; Unattended-Upgrade::Allowed-Origins:: "${distro_id}ESMApps:${distro_codename}-apps-security"; Unattended-Upgrade::Allowed-Origins:: "${distro_id}ESM:${distro_codename}-infra-security";The empty
Allowed-Originsline heads the list. Each child is anorigin:archivepair. The final dry run substitutesUbuntufor${distro_id}andresolutefor${distro_codename}, then prints the pairs aso=origin,a=archive.Stop before editing if the four allowed origins differ from those shown, if any origin patterns are configured, if
Unattended-Upgrade::Automatic-Rebootis enabled, or if you seeAPT::Periodic::Enable "0". - Confirm that
apt-daily-upgrade.timeris disabled at boot.$ systemctl is-enabled apt-daily-upgrade.timer disabled
Stop before editing if the result differs from
disabled. Amaskedtimer cannot be enabled. - Confirm that
apt-daily-upgrade.timeris inactive now.$ systemctl is-active apt-daily-upgrade.timer inactive
Stop before editing if the result differs from
inactive. - Refresh the APT package lists for the dry run.
$ sudo apt update Hit:1 http://security.ubuntu.com/ubuntu resolute-security InRelease ##### snipped #####
APT returns to the shell prompt when the refresh finishes. Stop before editing if the refresh fails or the output has no successful
HitorGetline forresolute-security InRelease. - Open a new
/etc/apt/apt.conf.d/90automatic-security-updatesfile in Nano.$ sudo nano /etc/apt/apt.conf.d/90automatic-security-updates
APT reads this file after
/etc/apt/apt.conf.d/20auto-upgrades, so the new intervals override the earlier settings. If Nano opens an existing file, stop and review it before editing. - Enter the daily package-list and unattended-upgrade intervals in the empty file.
APT::Periodic::Update-Package-Lists "1"; APT::Periodic::Unattended-Upgrade "1";
Each
1sets a one-day interval. The package-list refresh gives the upgrade job current information about available fixes.Once the file is saved, a scheduled upgrade can install packages and restart affected services. On a server where service interruptions matter, make the change during a maintenance window. To restore the previous APT settings, remove only
/etc/apt/apt.conf.d/90automatic-security-updates. - Save the new APT configuration file with Ctrl+O, followed by Enter to confirm the filename.
- Exit Nano with Ctrl+X to return to the shell.
- Confirm that APT reads both intervals as
"1".$ apt-config dump | grep -E '^APT::Periodic::(Update-Package-Lists|Unattended-Upgrade) '
If APT reports a syntax error, check the quoted values and trailing semicolons. If either interval differs from
"1", check for a later configuration file that overrides the new settings. - Enable the APT upgrade timer now and at boot.
$ sudo systemctl enable --now apt-daily-upgrade.timer
The persistent timer can catch up on a missed run soon after you start it. To return the timer to
disabledandinactive, runsudo systemctl disable --now apt-daily-upgrade.timer. - Check the next scheduled unattended-upgrade run.
$ systemctl list-timers apt-daily-upgrade.timer --full --no-pager
The
NEXTcolumn should show a future run forapt-daily-upgrade.timer. If no timer is listed orNEXTis blank, check the timer before relying on automatic installation. - Verify the allowed origins after the unattended-upgrade dry run finishes without errors.
$ sudo unattended-upgrade --dry-run --verbose Starting unattended upgrades script Allowed origins are: o=Ubuntu,a=resolute, o=Ubuntu,a=resolute-security, o=UbuntuESMApps,a=resolute-apps-security, o=UbuntuESM,a=resolute-infra-security ##### snipped ##### No packages found that can be upgraded unattended and no pending auto-removals ##### snipped #####
The simulation makes no package changes. The
Allowed origins areline should contain exactly the four entries shown: the Ubuntu release (resolute) and security (resolute-security) pockets and both ESM security pockets (resolute-apps-securityandresolute-infra-security). It should excluderesolute-updates,resolute-proposed,resolute-backports, and third-party origins. If no eligible packages are pending, the no-packages message above is a successful result. If APT is locked by a scheduled job, wait for it to finish before rerunning the simulation.The origin entries set the upgrade policy. Ubuntu Pro entitlement and enabled ESM repositories determine whether the system receives ESM packages.