Splitting Security and Weekly Unattended Upgrades on Ubuntu 24.04

2026-10-21·4 min read

Ubuntu 24.04 ships with unattended-upgrades enabled for security pockets, but mixing routine feature updates with daily security runs makes regression debugging noisy. Separating the two into distinct APT configuration profiles gives much better predictability.

1. Clearing Default Origins Before Appending

A subtle APT behavior catches many administrators off guard: configuration files loaded via Dir::Etc::main append to list directives already parsed from /etc/apt/apt.conf.d/50unattended-upgrades. To enforce a strict security-only profile, clear the list first:

#clear Unattended-Upgrade::Allowed-Origins;
Unattended-Upgrade::Allowed-Origins {
    "${distro_id}:${distro_codename}-security";
    "${distro_id}ESMApps:${distro_codename}-apps-security";
    "${distro_id}ESM:${distro_codename}-infra-security";
};
Unattended-Upgrade::Automatic-Reboot "false";

2. Respecting Phased Updates

Before invoking unattended-upgrade, running apt-get -s -o APT::Get::Always-Include-Phased-Updates=false upgrade lets a wrapper identify packages currently held back by Ubuntu’s phased rollout percentage and temporarily place them in Package-Blacklist. This keeps small production hosts off the bleeding edge of faulty early rollouts.

3. Conditional Reboot Windows

Leaving Automatic-Reboot "false" and evaluating /run/reboot-required inside a dedicated Sunday maintenance window ensures kernel updates apply cleanly only when active connections are idle and post-boot health checks are wired up.