Hi, Quoting Marc Haber (2020-03-22 12:20:37) > On Fri, 20 Mar 2020 10:16:00 +0100, David Kalnischkies > <da...@kalnischkies.de> wrote: > >On Fri, Mar 20, 2020 at 12:50:29AM +0100, Adam Borowski wrote: > >> In the rush for cutting away small bits of minbase, it looks like we forgot > >> a big pile of junk: /usr/share/doc/ > > > >Honestly, on space constraint systems, isn't the whole /usr/share/doc > >directory "junk". Probably not the solution for everyone or as > >a default, but I want to highlight that dpkg supports excluding files > >and entire paths from being unpacked: > > > >$ cat /etc/dpkg/dpkg.cfg.d/01_exclude_paths > >| path-exclude /usr/share/doc/* > >| path-include /usr/share/doc/*/copyright > >| > >| path-exclude /usr/share/locale/* > >| path-include /usr/share/locale/en* > >| path-exclude /usr/share/man/* > >| \u2026 > > Is there any canonical way to have a new system/chroot installed that > way? Debootstrap seems to make things particularly hard without using > internal interfaces (#811269, #864981, #871255, the oldest of those > having had its fourth birthday recently, with only a single > less-than-helpful maintainer interaction since then). > > How would I do that from the very beginning?
in practice, tools like debootstrap first extract the data part of the base *.deb packages using "dpkg-deb --fsys-tarfile", also called first-stage installation. Afterwards, packages are installed using "dpkg --install" from inside the chroot (this is often called the second stage). Since package data was already unpacked, the "dpkg --install" command will *not* remove the files indicated by --path-excluded. To make dpkg remove these files, a second "dpkg --install" has to be performed. Since debootstrap cannot do that yet (as indicated by the open bugs you cite), you'd have to chroot into your debootstrap rootfs and call "dpkg --install" again with all the packages affected by your chosen --path-exclude option. If you don't want to do this manually, then you can also use mmdebstrap instead of debootstrap and use its --dpkgopt option. For examples look at its man page or in the other message I wrote to this thread. Thanks! cheers, josch
signature.asc
Description: signature