ubuntu 20.04 unattended-upgrades don't start.
They should be started by the cronjob /etc/cron.daily/apt-compat
.
The first part of the script prevents that:
# Systemd systems use a systemd timer unit which is preferable to
# run. We want to randomize the apt update and unattended-upgrade
# runs as much as possible to avoid hitting the mirrors all at the
# same time. The systemd time is better at this than the fixed
# cron.daily time
if [ -d /run/systemd/system ]; then
exit 0
fi
My question is: how do I convince the script to pass the if condition. I understand the comment but it quite abstract.
There is no package deployed that contains this directory.
# dpkg -S /run/systemd/system
dpkg-query: no path found matching pattern /run/systemd/system
And please don't write me simply to delete this directory. It contains files.
# ls -la /run/systemd/system
total 4
drwxr-xr-x 3 root root 80 May 1 16:28 .
drwxr-xr-x 23 root root 540 May 1 16:28 ..
-rw-r--r-- 1 root root 299 May 1 16:28 netplan-ovs-cleanup.service
drwxr-xr-x 2 root root 60 May 1 16:28 systemd-networkd.service.wants `
I expect the unattended-upgrades to start with the cronjob.
I ran the script in debug with set -x
I ran the finally referenced command in the script exec /usr/lib/apt/apt.systemd.daily
. This work fine and starts the unattended-upgrade.