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

Re: Bug#458189: how to not install recommended packages?



On Sat, Dec 29, 2007 at 01:30:43PM +0100, Harald Dunkel <harald.dunkel@t-online.de> was heard to say:
> I am trying to setup some minimal Debian box (i386). Starting from
> the set of packages provided by debootstrap I used aptitude to install
> "jove". Even though "Install recommended packages automatically" was
> toggled off in aptitude's preferences, jove pulled in a lot of
> recommended (unwanted) packages including both sendmail and procmail,
> m4 and some others.
>
> The unwanted packages could be deselected later without "loosing"
> jove, so they were surely not necessary. So how comes that aptitude
> marked these recommended packages to be installed?

  It looks like some recent version of apt changed IsImportantDep to
return "true" for Recommends in all front-ends.

  Background: there's a method IsImportantDep on the apt policy object
that returns whether a non-critical dependency should cause its target
to be automatically installed by MarkInstall().  aptitude overrides this
in order to support installing recommendations, but to be polite it
calls back to the base class's method in order to find out whether apt
also thinks this is an important dependency.  If apt thinks it's
important, aptitude will accept this as gospel; if apt thinks it's not
important, aptitude will override this if it has been told to install
Recommends.  Note that aptitude enables installation of Recommends by
default.

  That's how things used to work.  However, in apt commit
1416.1.81.1, created 2006-09-07 by mvo, a configuration option
"APT::Install-Recommends" was introduced into apt which enables
installation of Recommends.  This configuration option defaults to
false, so normally Recommends were not considered important and
everything worked as before.

  Then in commit 1516.1.40, created 2007-10-15 by mvo,
Install-Recommends was pegged to "true" by the apt initialization code.
Now when aptitude asks apt whether a recommendation should be considered
important, apt always returns "true", and so aptitude's setting is never
checked.

  Obviously this is not what we want.  It is, however, desirable to obey
the same configuration options that apt obeys for the sake of
compatibility with other front-ends.  (although the user's settings
won't be read by other frontends, which is unfortunate)

  I see two main alternatives here:

    * Stop calling the apt policy object and just override its behavior
      completely.  This has the advantage that the behavior is now under
      aptitude's control and won't be changed unexpectedly by future
      changes to apt.  On the other hand, this means that aptitude will
      not behave like other apt frontends unless its code is explicitly
      updated to support new twists in the logic that determines which
      dependenxies to follow.

      This is the "take my toys and go home" option. :-)

    * Rewrite the aptitude code so that Recommends-Important
      short-circuits the logic if it's set to false (for backwards
      compatibility), and otherwise we fall back to IsImportantDep.

      The problem here is that using aptitude with an older apt will
      result in recommends not being installed by default.  Given that
      aptitude already needs a fairly recent apt, though, I'm not sure
      this is a real concern.

      I think this option is really the best choice.

  Ccing deity@lists.d.o since this may be of interest to other users of
  apt.

  Daniel


Reply to: