I’m experiencing a persistent issue where the Docker snap package automatically reinstalls itself on my Ubuntu 24.04 system, despite being completely removed using snap remove docker --purge.
System Information:
OS: Ubuntu 24.04 (Noble)
Snapd version: 2.71
Issue Details:
I have Docker CE installed via APT (official Docker repository)
I don’t need the Docker snap and have removed it multiple times using snap remove docker --purge
The Docker snap keeps reappearing automatically after a few days
This happens without any manual intervention from my side
What I’ve checked:
No other snaps depend on Docker (checked with snap connections)
No cron jobs or systemd timers are installing it
No VS Code extensions or development tools seem to trigger this
The snap refresh logs show it’s being installed, but don’t indicate the source
Questions:
Is there a known mechanism in snapd that could automatically reinstall previously removed snaps?
Could having Docker CE installed via APT trigger some compatibility mechanism that installs the snap version?
Is there a way to permanently blacklist/block a specific snap from being installed?
Are there any hidden configuration files or caches that might retain “memory” of previously installed snaps?
I’ve created a monitoring script to detect when this happens, and it consistently shows the Docker snap reappearing every few weeks (~3-4). Any insights into what might be causing this behaviour would be greatly appreciated.
I’ve also had the docker snap installed without manual intervention on my part twice. The second time was just a few days ago (I can’t be more specific as I haven’t used Docker for a few days).
With both the snap package and the apt package installed, there are multiple docker environments installed, and with every systemd Docker service reboot, it’s random which one will be available through the CLI.
I agree with you. Nevertheless, it happens and it’s very annoying. I know several coworkers who have the same issue.
How could package installation be logged?
You can surely check snap changes to see the install process logs … but this must be triggered from outside the snap system itself (some script or whatnot) that calls snap install docker …
have you checked your journal for the time-frame when these things happen ?
noticed it had happened to me again today; will double-check next time i run a snap refresh, because it was fine beforehand, and i’m pretty sure the snap core was the only thing that got picked up last time
I too have the exact same problem and can confirm everything OP has said. Despite using purge every time to remove it, it keeps coming back. It happens pretty much every month or so at least once. I have no other obvious software that would have the permission to do so. It must also have the permissions to shutdown the currently running daemon so it is definitely coming from an elevated process.
So, I’m not sure what your system is here, but I finally found the culprit on mine: snap “storage-explorer” from msft-storage-tools will try to grab docker when you update it, but does not list it under the “connections” area from what I can see.