On Sat, Mar 02, 2024 at 03:16:22PM +0100, Chris Hofstaedtler wrote:
> Given the C codebase and lack of any patches so far I do not see that
> deborphan will ever get these features, and we have other tools
> available that work, do not mess with dpkg internals and are actually
> maintained.

As people have asked so nicely, and not at all demanding, entitled
or otherwise bossy in this bug report, I've checked around a bit how
APT provides deborphan's functionality today.

As you all know, apt keeps track of when a package was installed
manually or automatically. This is mostly equivalent to manually
maintaining a deborphan keep file, but automated. apt-mark can be
used to manipulate the manually-installed state.

On top of that, apt-patterns(7) documents how to select packages,
including on sections, installed status, manually-installed status.
It can also used to select based on package names and regexes.

Thus, a good approximation of the default deborphan functionality
(no additional options passed) is:

$ apt-mark auto '~i !~M (~slibs|~soldlibs|~slibdevel|~sintrospection|~sdebug)'
possibly followed by
$ apt autoremove

If you're using --guess-<something> or --guess-section with
deborphan, you can copy the regex lists from deborphans source. A
lot of them are however outdated and wrong, so you were already in
"living dangerously" territory there.

And that's it. deborphan does not do any magic and you can do all of
it with apt.

Chris

Reply via email to