On 2021-05-09, Johannes Schauer Marin Rodrigues wrote:
> Quoting Vagrant Cascadian (2021-05-08 22:01:12)
>> I cannot seem to find a straightforward option to keep apt Packages
>> files in /var/lib/apt/lists/ ...
...
>>   mmdebstrap ...
>>   --skip=cleanup/apt \
>>   --customize-hook='chroot "$1" apt-get clean'
>
> this looks good.

It seems to work well enough.


>> But then maybe cleanup/apt might someday implement some other feature I
>> might miss out on by doing this...
>
> We can easily add two other skip options:
>
>    --skip=cleanup/apt/lists
>    --skip=cleanup/apt/cache

That would be nice!


>> If it doesn't make sense to implement this as a specific option in
>> mmdebstrap, at least documenting options to achieve this seems appropriate.
>
> The --skip options are documented in the next release of mmdebstrap:
>
> https://gitlab.mister-muffin.de/josch/mmdebstrap/src/branch/main/mmdebstrap#L6730

Yes, but not (yet) the ones you just proposed. :)


>> I can see several use-cases where you might want the Packages files to stay
>> around while cleaning the .deb files from the cache (e.g. sbuild, creating an
>> OS image or live image).
>
> I think we can agree that the contents of /var/cache/apt/ should be getting
> cleaned up in almost all cases.

I will agree to agree!


> What I'm wondering about is when /var/lib/apt/lists is actually
> useful. In all your cases above I do not see how. For example, sbuild
> will run "apt-get update" for you

True, though for several hours a day "apt-get update" can be a no-op and
save a bit of processing time, even if you're using a caching
proxy. Pdiffs can also save a bit bandwidth when that matters.

I've also found that generating a new sbuild tarball is fast enough with
mmdebstrap in some cases that it is as quick or even faster than
updating my old schroots used to be... so I'm likely to regenerate the
tarball before I start building packages with sbuild; the Packages file
is likely to be reasonably current in these cases and may as well be
included in the tarball.


> and system images usually get distributed to multiple places (so you
> want the image to be small) and are often only downloaded and used
> multiple days after their creation,

That is true, though Packages files do tend to compress quite well in
the grand scheme of things.


> which makes the content of /var/lib/apt/lists useless again because apt will
> need to re-download everything anyways.

The information does not necessarily become so stale as to be absolutely
useless. On a live image, I would like "apt search" to work without
having to first run "apt update", even if the data may be a bit stale.


So, I *feel* like it's useful to me, and worth documenting at least,
though I do like your proposed --skip=cleanup/apt/lists approach quite a
bit. :)


live well,
  vagrant

Attachment: signature.asc
Description: PGP signature

Reply via email to