`apt purge` does not remove /var/lib/docker
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
docker.io (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Preface
========
- I'm filing this against docker.io, but it might as well be a problem with apt.
- I experienced this with the docker.io package, but I can imagine, that there are other packages out there, that have exactly the same problem. Please read this report as an example for a perhaps generic problem.
What happened:
===============
- `apt purge docker.io` does not remove docker's file directory `/var/lib/docker`. Therefore previously used images and other files will be left on the system. This might be expected using `apt remove`, but `apt purge` should remove "config files" as well.
- The sysadmin does not get any messages, that there are files left on the system.
Generic Problem:
================
apt-get is supposed to manage files on a ubuntu machine. It fails to meet its goal in this case.
Concrete description:
=======
- This might be a difficult case, as docker images can be seen as "user files" (not config files). It would not be the right thing to remove those files.
- The general user does probably not know about this directory. This is a very potential file graveyard on the system.
- Upon installing no one tells the admin (in a clear, informative way), that there will be files create in `/var/lib/docker`. The information is hidden from the user. In that case, apt should be responsible for doing something about these files, if they get deleted.
Suggestions / Solution
=======
(I don't have *the* solution for this problem. I guess it's necessary to discuss what's the right thing to do)
My idea: Put them in $HOME/docker (or similar) instead of /var/lib/docker. (yes, they might be seen as "system wide user files", but I think real admins know how they could config paths and change the location while simple users immediately see that there's a `docker` folder in their home directory)
Ubuntu 20.10
docker.io:
Installed: (none)
Candidate: 19.03.13-0ubuntu3
Version table:
19.
500 http://
100 /var/lib/
ProblemType: Bug
DistroRelease: Ubuntu 20.10
Package: docker.io (not installed)
ProcVersionSign
Uname: Linux 5.8.0-32-generic x86_64
ApportVersion: 2.20.11-0ubuntu50.2
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: XFCE
Date: Sun Dec 6 08:00:37 2020
SourcePackage: docker.io
UpgradeStatus: No upgrade log present (probably fresh install)
This confuses me, because this is already implemented?
- https:/ /git.launchpad. net/ubuntu/ +source/ docker. io/tree/ debian/ docker. io.prerm? h=applied/ ubuntu/ devel /git.launchpad. net/ubuntu/ +source/ docker. io/tree/ debian/ docker. io.postrm? h=applied/ ubuntu/ devel
- https:/
It was added ~four years ago in 1.11.2-0ubuntu6:
docker.io (1.11.2-0ubuntu6) yakkety; urgency=medium
...
- remove "/var/lib/docker" on purge
...
-- Tianon Gravi <email address hidden> Fri, 19 Aug 2016 10:15:14 -0700
It sounds like maybe there's a bug where this isn't working correctly in all cases?