[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Autoremove triggers



Hi Dmitrii,

On Fri, Jun 7, 2013 at 9:32 AM, Dmitrii Kashin <freehck@gmail.com> wrote:
> A very interesting discussion have arised in debian-russian list. We
> are talking about APT::AutoRemove::RecommendsImportant trigger. The
> problem is there's no documentation for this hook in APT manpages, and
> we could only find some information about it in aptitude
> documentation.

Disclaimer: I will start with a fixup of the terms "trigger", "hook" and
"option". You seem to use them interchangeable, which will lead to madness
down the line as these terms have a definied meaning in APT context.
So bear with me for a minute:

"trigger" is something APT strictly doesn't deal with: Its a dpkg thing,
which you will see in the output of APT while dpkg is running.
See 'man 5 deb-triggers'.
"option" or "setting" or "config" are configuration options which are either
set implicitely by the actions you take, configuration files or on the
commandline with the '-o/--option' flag.
"hook" is a special option, which usually is in fact a list of (unnamed)
options under this scope. Meant is that commands set with this option are
executed at a (documentation-)defined place.


> Nevertheless, there's a file /doc/examples/config in sources. And
> according to the comment in the begin of this file I guessed that it's
> a complete list of triggers for APT. But there's no APT::AutoRemove
> group there.

I presume you mean /usr/share/doc/apt/examples/configure-index.gz

The comment is indeed a bit glorified: APT has (way to) many options and
while the file lists a lot, it doesn't list all as it isn't updated always.

I am not sure about how to fix this, as I am unsure about the usefulness of
this file at large as a file with a lot of options isn't documentating
anything at all beside that we have a lot of options …

'man 5 apt.conf' is the better place to be for an option, but we really
shouldn't document all options in there either …

> Therefore we have a question. Is APT::AutoRemove group is originally
> developed by aptitude developers or maybe this hook was forgot to
> describe by maintainers of APT?

Yes, the whole "autoremove" infrastructure was initially done by Daniel
Burrows (initial aptitude author) and 'later' merged into libapt-pkg for
the benefit of all APT frontends. Note that this happened well before
Debian lenny (5.0) [and well before my appearance on the scene] which
if I read the changelog correctly was 2007 together with the installation
of Recommends by default.


So, after this (now suprisingly long introduction) lets answer the question
itself: Yes, the option exists and will be respected by default by all
applications using libapt even though they have the option of overridding
this (dev note: bool pkgDepCache::MarkFollowsRecommends() ).

That said: I *STRONGLY* recommend to _NOT_ change it!

Recommends are supposed to be installed on "all but unusual systems" (as the
debian-policy says it), so disabling the installation of recommends or
allowing the autoremove algorithm to remove them is NOT recommend as it will
result in crippled systems if you are not really really careful.

btw: There is also the APT::AutoRemove::SuggestsImportant setting which is
enabled by default nowadays, too, while suggests aren't installed by default.
I can imagine that some people might want to disable that, but as it removes
features (otherwise packages wouldn't suggest it) I am not keen on recommend
even that as this is not in line with "removing unused packages".


Which is the reason for me to not document them in manpages.
What we do with the index remains to be seen.


As you see, my answer (without pre-text) is short as I wasn't exactly sure
what the questions were as while I think I found the discussion [0] I
can't really read it…


Best regards

David Kalnischkies

[0] https://lists.debian.org/51AF5910.2020609@sergio.spb.ru


Reply to: