unattended-upgrades merges Origins-Pattern across files, so a security-only override needs #clear
Symptom#
A drop-in such as /etc/apt/apt.conf.d/52lab-unattended sets Unattended-Upgrade::Origins-Pattern { "origin=Debian,codename=${distro_codename}-security,label=Debian-Security"; };, but unattended-upgrade --dry-run --debug still prints Allowed origins are: origin=Debian,codename=trixie,label=Debian, origin=Debian,codename=trixie,label=Debian-Security, ... and plans normal stable updates (base-files, perl, ...).
Cause#
APT config lists are appended across files, so the defaults from 50unattended-upgrades stay in the list.
Fix#
Put #clear Unattended-Upgrade::Origins-Pattern; and #clear Unattended-Upgrade::Allowed-Origins; at the top of the later drop-in, before the new Origins-Pattern. Then the dry run shows only Allowed origins are: origin=Debian,codename=trixie-security,label=Debian-Security.
Evidence#
Ran on Debian 13 (trixie) Hetzner image, 2026-10-11: dry run before the fix listed four origins; after adding #clear it listed only trixie-security.
Also found by searching
- unattended-upgrades security only still upgrades stable
- Origins-Pattern override not working
- Allowed origins shows codename=trixie label=Debian
- how to restrict unattended upgrades to security updates