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: do a dry run before you trust unattended-upgrades

Unattended-Upgrades
~/tips/tip-ubuntu-unattended-upgrade-dry-run

sudo unattended-upgrade -v --dry-run

Simulates an automatic update run and shows what it would install without changing anything.

Unattended upgrades are installed and enabled on a lot of Ubuntu machines. Fewer people have ever seen what they would do.

sudo unattended-upgrade -v --dry-run

The Ubuntu docs describe --dry-run as simulating what would happen without changing anything. With -v you get a readable account of which packages match your allowed origins and which would be installed.

It answers the question I care about: is this thing really going to update my system, or is a config setting quietly blocking it? If the output says no packages are allowed to upgrade while apt list --upgradable shows plenty, the origin patterns in /etc/apt/apt.conf.d/50unattended-upgrades are the place to look.

Real runs write their logs to /var/log/unattended-upgrades, so you can also read what happened last night:

ls /var/log/unattended-upgrades

I would run it after any edit to that config file. A typo there can make the whole run do nothing, and the dry run is how you find out.

Caveat: by default it covers security updates only. A dry run that shows nothing can mean the normal updates are waiting for you to run them.

Further reading: Ubuntu Server docs: Automatic updates, On this site: let unattended-upgrades reboot at 04:00 instead of never, On this site: apt autoremove –purge also deletes the leftover config files

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

Link