apt-daily.service running too early in boot process

Asked by mapatma on 2017-01-31

Hi,

I'm not sure whether this is a bug or some misconfiguration with my system, but I noticed that the package cache was only being updated very occasionally even though APT::Periodic::Update-Package-Lists "1" is set.

I figured out that this is because on most days apt-daily.service is triggered early in the boot process when the network is not up. Since the timer is set to run approximately every 12 hours, and the system is only on for a few days, the timer tends to lapse over night and is then triggered as soon as the system is booted the following day.

Also, `apt-get update` returns true regardless of whether there is a network connection, so the apt.systemd.daily script updates the timestamp file regardless.

I have worked around this by adding the following to the apt-daily.service:
Wants=network-online.target
After=network-online.target

I'm not sure whether this is the best way to do things, but it seems to work at least on my system and the apt-daily service is now running later in the boot process.

Just let me know if you would like further info or if I should submit a bug report. The system is ubuntu mate 16.04 system with update-notifier installed and apt version 1.2.18

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu apt Edit question
Assignee:
No assignee Edit question
Last query:
2017-01-31
Last reply:
2017-01-31

I suggest you report a bug. Add your fix as a solution

Can you help with this problem?

Provide an answer of your own, or ask mapatma for more information if necessary.

To post a message you must log in.