Am Wed, Nov 06, 2024 at 01:59:59AM -0600, schrieb Aaron Rainbolt:
> 4. Install the package with `sudo apt install ./test-meta_1.0_all.deb`.
> 5. Purge the package with `sudo apt purge test-meta`.
> 6. Run `sudo apt autopurge`.
> 
> Expected result: `gitk` should be removed during the autopurge step.
> 
> Actual result: Only the test-meta package is removed.

That might be expected if there are mere seconds between step 4 and 5 as
the user has realistically only interacted with test-meta in that time
frame. The longer the time is between these two steps through it becomes
possible that the user discovered gitk and fell in love with it.

autoremoving it would be very wrong then (and gitk is a really bad
example here as you interact with it directly; many recommends "just"
enable features within the package that recommended them).


Thankfully, we don't need to debate how many minutes have to be between
the two to behave one way or the other.

1. If you dislike the behavior for Suggests entirely, disable it:
  APT::AutoRemove::SuggestsImportant "false";

2. Your step 5. would be better expressed as a sort-of 'undo'. There
   exists requests for it, some pre requirements (like history.log),
   "all" that is missing is the actual code of course.

3. Instead of trying to track which packages caused which other packages
   to install¹ you might be better off with given the user a chance to
   say: "git was suggesting gitk, but I resisted." to ignore that
   relation (instead of the global switch from 1.). Does not exist in
   apt and I think it shouldn't as it is too needy and kinda needs
   a dedicated front end for the constant user interaction.

4. Its important to remember that autoremove is not meant to help you
   maintain a lean and clean system. It is trying to remove "obvious"
   obsolete stuff, but if it can't decide, it will always opt for keep
   because user attention, knowledge and time is limited, but disk space
   usually isn't ~ in the general case at least.


¹ Lets say: pkga recommends foo, pkgb suggests foo. You install pkga
(which also brings in foo). After a while you install pkgb and use it
– especially that feature only enabled by foo, but how do you know that.
Six months later you remove pkga. Are we autoremoving foo now?
It was never installed due to pkgb, it was already there.
How about if pkga is replaced in an upgrade with pkgc that doesn't
recommend foo? What if we don't deal with 3 but 300 packages?


So, in short: I think your suggestion is over-fitted for your example
and I believe your example would be better served by 2. for which
bug reports already exist, so adding another doesn't help & I am
therefore closing this one (as sorta duplicate).


Best regards

David Kalnischkies

Attachment: signature.asc
Description: PGP signature

Reply via email to