:: Re: [devuan-dev] On joining Devuan …
Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Olaf Meeuwissen
Ημερομηνία:  
Προς: devuan developers internal list
Υ/ο: Dmitry Bogatov
Αντικείμενο: Re: [devuan-dev] On joining Devuan development team

Evilham writes:

> On dv., ag. 23 2019, Dmitry Bogatov wrote:
>
> [snip]
>
>>>    - service files: we are not removing these as they are harmless
>>>    and not worth the overhead to remove them. There was a setting
>>>    to keep those from being installed by apt, I can look for it
>>>    and we probably should add that to documentation since people
>>>    ask this all the time, but it shouldn't be a reason to fork
>>>    packages and not worth the added effort over many packages.

>>
>> Okay. By the way, it is dpkg --ignore configuration, not apt.
>> Something like
>>
>>     echo 'path-exclude=/var/lib/system/*' >> /etc/dpkg/dpkg.cfg.d/exclude

>
> Wonderful, we should add this somewhere to the webpage, thank you.


I've posted a similar "dpkg hack" to the DNG mailing in the past. It
should have been available at

https://lists.dyne.org/lurker/message/20180726.123546.eacb6518.en.html

but for some reason that appear to have been deleted :-?

Anyway, here the relevant part of that post (dug out of my sent mail):

Actually, you can keep these files off your systems fairly easily
without the need to fork, rebuild and maintain piles of packages.
The idea is to exploit the power of dpkg's --path-exclude option.
Please note that the dpkg(1) manual page says

    Warning: take into account that depending on the excluded paths you
    might completely break your system, use with caution.


So if you try this and stuff breaks you get to keep the pieces ;-/

You can add a /etc/dpkg/dpkg.cfg.d/systemd-razor file that contains
path-exclude globs for all the systemd files you want to get rid of
like so

    path-exclude=*systemd*
    path-include=/etc/dpkg/dpkg.cfg.d/systemd-razor


although you might just want to be a bit more subtle ;-)

# See dpkg.cfg(5) for (scant) details.

The above prevents installation of any new "offending" files (while
keeping the systemd-razor file installed, doh). To get rid of files
already installed, you can retro-actively apply the above on what's
installed already like so-ish

    find / -name '*systemd*' ! -name systemd-razor -delete


with appropriate privileges, i.e. as root. Please adjust if you used
[another or more] exclude pattern[(s)].

People that want to do so can do this themselves rightaway and Devuan
*could* add this dpkg.cfg.d file to a suitable package (and the find
invocation in that package's postinst). The latter only after a good
deal of testing of course.

Disclaimer: None of the above has been tested (although I do use this
approach to clean out /usr/share/doc in my devuan/slim Docker images,
see https://gitlab.com/paddy-hack/devuan).

Hope this helps,
--
Olaf Meeuwissen, LPIC-2            FSF Associate Member since 2004-01-27
 GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13  F43E B8A4 A88A F84A 2DD9
 Support Free Software                        https://my.fsf.org/donate
 Join the Free Software Foundation              https://my.fsf.org/join