PACKAGES aptitude
Holger Parplies
wfai at parplies.de
Sat Jul 9 03:53:23 CEST 2011
Hi,
Michael Tautschnig wrote on 2011-07-09 00:37:50 +0100 [Re: PACKAGES aptitude]:
> > >>>>> On Fri, 8 Jul 2011 10:11:22 -0500, "John G. Heim" <jheim at math.wisc.edu> said:
> > > Does it make any difference what order the packages are listed in a package
> > > config file? I like to sort my lists of packages to make it easier to avoid
> > > mistakes. But I'm not sure I should be doing that.
> > I'm not sure if aptitude's dependency resolver cares about the order
> > of package names. I would not try to sort them alphabetical. Inside
> > the packages_config files I sort them by topics. I group my base
> > packages and some additional network packages and my Debian tools, and
> > so on.
>
> I'd just like to add a non-negligible bit of information here: if you package
> list grows too large, install_packages will split it into chunks. This is the
> point where the dependency resolver could kick in in different ways, depending
> on which groups of packages are formed. For instance package X might depend on
> either A or B. If you have B in your list anyway, but ending up in a different
> group than X, the dependency resolver might have chosen A over B, and you end up
> with either A being installed and removed afterwards if conflicting with B, or
> both A and B on your system.
I've seen that happen.
If I'm not completely mistaken, *apt-get* will have that problem (or at least
used to) even if they land in the same chunk, but in the order 'X B'.
Now, if you have all packages in a single package_config/MYCLASS file, then
you can easily solve that problem by ordering your packages accordingly (well,
it's not *that* easy, because you first have to locate all these
dependencies (*)), but that no longer applies if you use multiple classes for
each host, where each class adds its own package list. If I'm not mistaken, FAI
concatenates package lists in the order the classes are defined (which makes
sense - install basic packages first, then continue in order of growing
specialization). So, what do you do, if you have a class FOO which includes
package X (and its configuration), which is supposed to use the default
dependency A, and you have a second class WITH_B, which is meant to modify FOO
to use X with B instead? package_config/WITH_B would obviously include 'B' (and
you'd ideally like it to appear in the overall package list *before*
package_config/FOO), but under files/ you'd have files named WITH_B which are
supposed to override the FOO versions, and under scripts/WITH_B you'd have
scripts needing to run *after* those in scripts/FOO.
You can probably have a 'PACKAGES aptitude WITH_B' stanza in
package_config/FOO, but I'd guess that gets really complicated if you have
several dependencies of this sort.
The 'simple' solution seems to be defining MAX_PACKAGES=1000 (or whatever is
'large enough'), making /var large enough, and ***hoping*** that aptitude
actually *doesn't* care about the order of the packages. Can anyone confirm
that this hope is justified?
I admit I don't currently have this problem, but with increasing
debian_version I tend to have more and more dependencies I want to have
resolved in a non-default way.
Regards,
Holger
(*) If you want a *lot* of information in your fai.log about why which
dependency was installed, create a hook prepareapt.MYCLASS containing
#!/bin/sh
(
echo 'Aptitude::CmdLine::Show-Why "true";'
echo 'Aptitude::CmdLine::Verbose "1";'
) > $target/etc/apt/apt.conf.d/50explanations
You might want to remove the file again at the end of the installation ;-).
More information about the linux-fai
mailing list