On Tue, 12 Mar 2024 10:22:25 +0200 =?UTF-8?Q?Martin=2D=C3=89ric_Racine?= <martin-eric.rac...@iki.fi> wrote: > On Mon, 11 Mar 2024 15:18:44 +0100 Chris Hofstaedtler <z...@debian.org> wrote: > > 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. > > Thanks for making the effort to investigate possible substitutes. > > However, those are all approximations, not a direct substitute. All of > these methods essentially require whitelisting, blacklisting or > auto-marking packages for future processing. Meanwhile, deborphan > makes good guesses on the fly. Yes, its methods are kinda outdated, > its misses support for some of the recent dpkg bells and whistles, but > it still does a good enough job for most cases, as attested by its > popularity contest rating just below 10k. > > Sorry, I really think that the correct action is to orphan the > package, not remove it.
Another issue I've run into to try and replace deborphan with some apt-mark recipe: apt-mark's regex syntax is not documented. The man page merely lists the commands and options available. For instance, I have no idea how you came up with the above regex recipe, or how I would tell apt-mark to never mark as "auto" anything with a priority important or higher. At best, I can tell that whatever follows each |s lists in the above recipe is a Debian repository section. Martin-Éric