APT seems to have a persistent blind spot for computers that are not permanently connected to the Internet. These days, there are surely a ton, mostly laptops.
The general solution is
unattended updates. This is installed and run by default with a daily log
cron employment. As protection,
anacron is also installed and run by default, and runs everything
cron jobs that were missed because the computer was off. Until here so reasonable.
unattended updatesconfig (
/etc/apt/apt.conf.d/50unattended-upgradesor similar) requires the following configuration, otherwise the upgrades may be ignored:
Unattended-Upgrade :: OnlyOnACPower "false"; Unattended Upgrade :: Skip-Updates-On-Metered-Connections "false";
cron, performs work, whether an Internet connection is available or not! This is clearly a major design bug for non-server Ubuntu because personal computers are not always connected constantly. With the default configuration, on a nomad laptop,
unattended updateswill just fail a lot of the time.
(Perhaps a separate class of
cron work that waits for a network connection until it runs. Or failed
cron.daily jobs could be switched to
cron.hourly until they perform successfully.)
A practical solution is a
systemd file unit to execute
unattended updates as a user script after going online. But it will only work once per boot.
What is the optimal solution? Does anyone know if it is planned to solve this problem with a new package or a configuration enhancement?