#1140309 docker.io: Asks to remove data during installation, which is confusing

Package:
docker.io
Source:
docker.io
Description:
Linux container runtime
Submitter:
Arnaud Rebillout
Date:
2026-08-11 16:07:03 UTC
Severity:
normal
Tags:
#1140309#5
Date:
2026-06-18 04:44:50 UTC
From:
To:
Hello Reinhard,

the issue is easy to reproduce: start a Debian:sid container or VM, and
install docker.io.

Output:

```
[...]
Preconfiguring packages ...
Configuring docker.io
---------------------

The /var/lib/docker directory contains Docker images, containers, and
volumes. If you choose this option, all this data will be permanently
removed when the docker.io package is purged.

If you are replacing docker.io with another Docker distribution (like
docker-ce), or if you want to keep your data, you should choose not to
remove it.

Remove all Docker data? [yes/no] yes

Selecting previously unselected package libcom-err2:amd64.
(Reading database ... 4918 files and directories currently installed.)
[...]
```

Since I'm installing the package on a clean system, there is no data,
so why does it ask me to remove data that doesn't exist?

I suppose the code could be gated to the upgrade case only (ie. if [ -z
"$2" ] in the postint).

This bug report is about installing docker.io in a clean environment,
but we can extend it to upgrading systems where docker.io is already
installed.

The postinst basically asks me, when the package is upgraded:

However it doesn't remove any data, it just sets a flag to remove or not
remove data _later_ when (if ever) the package is purged. I think the
wording is confusing.

Another thing that is confusing, from this message:

I am not replacing anything, I am just upgrading my system. But wait.

So I'm supposed to decide _now_ what to do with the data? How can I take
a decision for an event that didn't happen yet? Maybe next year, I will
remove the package, or maybe I will switch from docker.io to docker-ce.
So it's the answer that I gave 1 year ago that will decide what will
happen to my data? I think this approach is not going to work.

I've had a brief read at #1021914, and I read it as a bug report from a
user that configured APT to always purge data, and was then surprised to
see that APT purged its data... I think this APT config flag is
dangerous, and users shouldn't set it on their system. Maybe the APT
documentation should be more explicit that setting this flag is not a
great idea.

If ever docker's data is so important that it warrants an exception, and
should leave data behind even when it's purged, then maybe ask the
question about what to do _at the moment_, ie. when the package is
purged?

However packaging best practice say that "prompting in any case can only
be in the configure stage of the postinst script", cf.
<https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.en.html#best-practices-for-maintainer-scripts>

I don't have the right answer here, I'm not really familiar with
debconf. I'd be tempted to drop all the debconf thing here. Either purge
data, or don't purge data, no need for more granularity.

What does podman do in this case? What about incus? Maybe just align
with those packages.

Hope that helps.

Best,

Arnaud

#1140309#8
Date:
2026-06-28 08:05:22 UTC
From:
To:
Hello,

Bug #1140309 in docker.io reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/go-team/packages/docker/-/commit/22f453f0e399a7093856b10ea60bdaa9d734d241
------------------------------------------------------------------------
Update changelog for debconf prompt clarification

Closes: #1140309, #1137581
------------------------------------------------------------------------

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/1140309

#1140309#15
Date:
2026-08-11 16:05:01 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
docker.io, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1140309@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Mathias Gibbens <gibmat@debian.org> (supplier of updated docker.io package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Tue, 11 Aug 2026 15:35:37 +0000
Source: docker.io
Architecture: source
Version: 28.5.2+dfsg4-4
Distribution: unstable
Urgency: medium
Maintainer: Debian Go Packaging Team <team+pkg-go@tracker.debian.org>
Changed-By: Mathias Gibbens <gibmat@debian.org>
Closes: 1137581 1140309
Changes:
 docker.io (28.5.2+dfsg4-4) unstable; urgency=medium
 .
   * Team upload
 .
   [ Mathias Gibbens ]
   * Include go.mod files in the -dev package
 .
   [ Reinhard Tartler ]
   * Clarify debconf prompt regarding Docker data purge vs removal.
     (Closes: #1140309, #1137581)
Checksums-Sha1:
 94c7806de6b06c925c5cef39704515a74e79a99a 9321 docker.io_28.5.2+dfsg4-4.dsc
 6406f48bbf20d2632fc9e0efee815806b56b33e4 1162896 docker.io_28.5.2+dfsg4.orig-buildkit.tar.xz
 76db77b27b6dbf83025a471f2fd7535b932dd270 1323228 docker.io_28.5.2+dfsg4.orig-cli.tar.xz
 e4c07f9011cb8f39be38b19a3d4fd7f0bd2764c6 3934172 docker.io_28.5.2+dfsg4.orig.tar.xz
 6dbdc5a98837925328315ee5fba68e9860b75f8d 69908 docker.io_28.5.2+dfsg4-4.debian.tar.xz
 8f82c9d1ff5185e5bd622e1ccae684ce0fd3cc54 38153 docker.io_28.5.2+dfsg4-4_amd64.buildinfo
Checksums-Sha256:
 0b4eb5f3b3b2dbd93d3c3848f32e2e201f89cb8e4e493f9162dbdf558cc39631 9321 docker.io_28.5.2+dfsg4-4.dsc
 edcba2ad2d226bd79bc05b42af1b87015636b94fa98c5a39928e19f1b9f45803 1162896 docker.io_28.5.2+dfsg4.orig-buildkit.tar.xz
 c06ea92d25515ce0c3be4f03991447d56f02a951724d7700d108c05856fa868d 1323228 docker.io_28.5.2+dfsg4.orig-cli.tar.xz
 2b390db1e12edabfa0a45e9ae03aece8f5933961e059da2dc79b1986c16e378e 3934172 docker.io_28.5.2+dfsg4.orig.tar.xz
 c4453776cd5dd1fb863171cbc9acbafcc9e7793d54873a4c1852abbf8ace9c0c 69908 docker.io_28.5.2+dfsg4-4.debian.tar.xz
 4a3aeee2ce10dfc8c3e97d550d538bfe5b78bb8d9c966768813d02750fd5f049 38153 docker.io_28.5.2+dfsg4-4_amd64.buildinfo
Files:
 49ab6842f913a35cada2d3ef2b075da1 9321 admin optional docker.io_28.5.2+dfsg4-4.dsc
 7c7338ae40df2ab7e9c283826ffcef06 1162896 admin optional docker.io_28.5.2+dfsg4.orig-buildkit.tar.xz
 83a65493402af3ee4c120697c500c9c4 1323228 admin optional docker.io_28.5.2+dfsg4.orig-cli.tar.xz
 37bb94c68ea4cc3f307f44f188c595f0 3934172 admin optional docker.io_28.5.2+dfsg4.orig.tar.xz
 8e958a98522d30f0246c92ef99a6e424 69908 admin optional docker.io_28.5.2+dfsg4-4.debian.tar.xz
 2b1ea390980660998a4a9b44b7b8b9a6 38153 admin optional docker.io_28.5.2+dfsg4-4_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----

iQJGBAEBCgAwFiEE1Bp60H32xfynSJ8cKe7i1uz0QvkFAmp7Q9cSHGdpYm1hdEBk
ZWJpYW4ub3JnAAoJECnu4tbs9EL5nJwP/Rqeop0vbLsRSkh4XhsZ3NVh/gFhUbEv
2WvSdXE3nk3eeoeYNlWrxXihR5VfFJ9xaPKjrtXHYHxexN753UUWBF9KDnIymuQ+
1Zy2eNWLfDu3ENCE8k2FL36eX102GON81CWCSEPW+NRFZKFac6INFV2ujU3wrcMK
ZnHckBhx11LHLuN5zbFeCpRGaCgNTac4i0Fvrl7MV/TwNYFjpgMAlzlUEK+2hQKE
YIQedwRE472DhLfiWtLL51m5Tz37WUoTWuvZrjydaBGur0rBDTprCBj4L7kbSa5y
DKoZDhquwbCrAExRlq3a+Ha1VB76VWakQ8qpp/m+OyyRMnacKOtaQ8Xn62OoApka
kgDgeZ3LfqfcVYBVUiGI1hhILkvOkotCQSwtlsDZOsPSZaXPSBQ6WSw/raic5+93
lCu6Kgz0BKedwOvuU4NaH7Cm815gyU6Ndbza7TBzUkMS7f6xn5ESclBdC6XX5Ogr
LPlwSk78VGiuZBn0WfflKe4b49mQy2wU6LhUsnIA+xvL1WouPhdgSlb+NY/ht5Gf
HocT1AShRS9Dprb6eoKUZg7ZyvYCOzSXtGoibqLkMspZiQQF8KkJ6gOEEkxNBCsF
2d6nVLfC3//wMLCXNxFLiYuqbpzmmtkwsBBikVtZ6Lc/7lFqrvbrQn6LgZ9QJwEL
QxfwyobF7yYU
=QKae
-----END PGP SIGNATURE-----