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: Two APT::Periodic lines decide whether unattended-upgrades runs at all

Unattended-Upgrades
~/tips/tip-unattended-upgrades-20auto-upgrades

cat /etc/apt/apt.conf.d/20auto-upgrades

Check the switch that turns daily automatic upgrades on.

Having the unattended-upgrades package installed does not prove that anything runs. The daily job reads two settings first.

Look at the file where Ubuntu normally keeps them:

cat /etc/apt/apt.conf.d/20auto-upgrades

For automatic upgrades you want this:

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";

The first line refreshes the package lists and the second runs the upgrade. The number is an interval in days, so 1 means daily and 0 switches that step off. Without fresh lists the upgrade step has nothing new to install, which is why both lines matter.

If the file is missing, create it with those two lines, or let the package write it:

sudo dpkg-reconfigure -plow unattended-upgrades

Answer yes to the question. Since another file in the same folder can override these values later, ask apt for the final result:

apt-config dump APT::Periodic

That is what I check on any server I inherit.

The timers also have to be active, so peek at systemctl list-timers 'apt*'. A server that is switched off most of the day may run the job later than you think.

Further reading: unattended-upgrades README

More Unattended-Upgrades tips sudo nano /etc/apt/apt.conf.d/52unattended-upgrades-local apt-cache policy 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