brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: unattended-upgrades can skip chosen packages with Package-Blacklist

Unattended-Upgrades
~/tips/tip-unattended-upgrades-blacklist

sudo nano /etc/apt/apt.conf.d/52unattended-upgrades-local

Keep automatic updates on while a few sensitive packages wait for you.

Some packages I would rather update myself, for example a database where I want to read the notes first. unattended-upgrades can leave them out.

Put your own settings in a separate file, so a package update does not collide with your edits:

sudo nano /etc/apt/apt.conf.d/52unattended-upgrades-local

Add the list:

Unattended-Upgrade::Package-Blacklist {
    "postgresql";
    "docker-ce$";
    "libc6$";
};

The entries are Python regular expressions matched against package names. postgresql catches every package that starts with it, while the $ on the end of docker-ce$ limits the match to that exact name and leaves docker-ce-cli alone. Check the effect with a dry run:

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

The debug output mentions packages that are skipped because of the list.

The big catch is that a skipped package also misses its security fixes. Set yourself a reminder to update those by hand, and keep the list short. Packages that need a newer version of a blacklisted one are held back too, which can grow into a longer queue than you expected.

Further reading: unattended-upgrades example config, unattended-upgrades README

More Unattended-Upgrades tips apt-cache policy cat /etc/apt/apt.conf.d/20auto-upgrades Unattended-Upgrade::Mail "[email protected]"; sudo systemctl edit apt-daily-upgrade.timer Unattended-Upgrade::Automatic-Reboot "true"; All Unattended-Upgrades tips (7) All topics

Link