Hi, 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/ ... > > If I use --skip=cleanup/apt it does keep the Packages files in > /var/lib/apt/lists, but also leaves the .deb files in /var/cache/apt/, > which is largely undesireable for several use-cases. > > Using --customize-hook to run apt-get update occurs after the cleanup > steps are run... > > I guess this wouldn't be too bad (untested): > > mmdebstrap ... > --skip=cleanup/apt \ > --customize-hook='chroot "$1" apt-get clean'
this looks good. > 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 > 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 > 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. 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 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, which makes the content of /var/lib/apt/lists useless again because apt will need to re-download everything anyways. > Thanks so much for mmdebstrap; a very nice tool! You're welcome. :) cheers, josch
signature.asc
Description: signature