Score:0

Docker restarted by dist-upgrade despite being pinned and staying the same version?

my flag

Having read this answer on Ask Ubuntu: What is “dist-upgrade” and why does it upgrade more than “upgrade”?

I'm still not sure what happened here in my situation.

On a local server, Ubuntu 18.04, I have docker pinned to an older version.

The file is located here: /etc/apt/preferences.d/docker-ce.pref

And the contents are:

Explanation: Pin added by Ansible role "nickjj.docker"
Package: docker-ce
Pin: version 19.03.5-ce*
Pin-Priority: 600

Someone performed sudo apt-get update and then sudo apt-get dist-upgrade on this server, according to the auth.log file.

Docker didn't get upgraded, but was clearly restarted. I learned this because the service file in /lib/systemd/system/docker.service was reset to the default.

After this, I learned you shouldn't do edits there, but do sudo systemctl edit docker.service.

But that's another story. Point is: I did make those edits in the past and then they were gone. The service had either been upgraded or restarted, and it turned out it wasn't upgraded.

I don't get why it restarted. It's pinned, so it shouldn't come up during upgrades.

That being said, dist-upgrade details some sort of conflict resolution between dependencies.

Could it be that dist-upgrade forced a restart of the service?

No other commands were found in auth.log, it's really weird.

nobody avatar
gh flag
Try pin priority 1001
in flag
Yes, `dist-upgrade` will restart services where required. Just because Docker didn’t receive any updates doesn’t mean that a dependency didn’t
my flag
@matigo Gosh darnit. Well, if you turn that into a fully fledged answer I'll mark it as the accepted answer.
vn flag
You can probably also verify whether the docker version changed (sounds like there's some uncertainty) by checking /var/log/apt/history.log.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.