Matthew Palmer wrote:
On Wed, Jun 10, 2009 at 10:44:46AM +1000, Jayen Ashar wrote:
How can I set aptitude as my preferred package provider globally? I can't find any documentation on it, and a google search for "global preferred package provider" (and variants) doesn't give me anything useful.

Default the provider for the Package type to be aptitude.  There's docs on
that.

I really can't find them. I've search for "default provider" (and variants) and still can't find it. All I can find are things saying puppet chooses a default provider, based on the os. I can't actually find the name nor location of a global setting. Could you please provide a pointer? Thanks.

Is there any documentation on why apt-get is the default for debian/ubuntu, when aptitude is installed?

Because nobody's put forward a patch to do it differently.

Your problem isn't aptitude vs apt-get, though -- apt-get is perfectly
capable of resolving and installing dependencies.  My guess is that you
haven't setup your preferences correctly to tell Puppet to install dependent
packages from your backports repo:

  APT prefers stable
  APT policy: (500, 'stable')
Basically, your system config is screwed, and it's not Puppet's fault. Nor
will switching to aptitude solve your problem (unless it ignores repo
preferences).

If my system config were screwed, or I didn't set backports in my preferences, then I would have the opposite problem, and backports would take precedence over stable, since backports contains higher versions. The bug report didn't include my apt_preferences, which contains:
  Package: *
  Pin: release a=lenny-backports
  Pin-Priority: 200

Furthermore, I've tested apt-get and aptitude, and while "/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install openoffice.org-core=1:3.0.1-11~bpo50+2" doesn't do what I want, "/usr/bin/aptitude -q -y -o DPkg::Options::=--force-confold install openoffice.org-core=1:3.0.1-11~bpo50+2" does. (Although I realize auto-resolving with aptitude would give me things like:
  The following actions will resolve these dependencies:

  Remove the following packages:
  openoffice.org
  openoffice.org-style-andromeda

whereas apt-get would not be so bold, I think this is generally the preferred behavior, rather than being thrown into dependency hell.)

Thanks,
Jayen
diff --git a/lib/puppet/provider/package/apt.rb b/lib/puppet/provider/package/apt.rb
index a99ee4c..2aa8ec9 100755
--- a/lib/puppet/provider/package/apt.rb
+++ b/lib/puppet/provider/package/apt.rb
@@ -10,8 +10,6 @@ Puppet::Type.type(:package).provide :apt, :parent => :dpkg, :source => :dpkg do
     commands :aptcache => "/usr/bin/apt-cache"
     commands :preseed => "/usr/bin/debconf-set-selections"
 
-    defaultfor :operatingsystem => [:debian, :ubuntu]
-
     ENV['DEBIAN_FRONTEND'] = "noninteractive"
 
     # A derivative of DPKG; this is how most people actually manage
diff --git a/lib/puppet/provider/package/aptitude.rb b/lib/puppet/provider/package/aptitude.rb
index 699df0e..b5ad419 100755
--- a/lib/puppet/provider/package/aptitude.rb
+++ b/lib/puppet/provider/package/aptitude.rb
@@ -6,6 +6,8 @@ Puppet::Type.type(:package).provide :aptitude, :parent => :apt, :source => :dpkg
     commands :aptitude => "/usr/bin/aptitude"
     commands :aptcache => "/usr/bin/apt-cache"
 
+    defaultfor :operatingsystem => [:debian, :ubuntu]
+
     ENV['DEBIAN_FRONTEND'] = "noninteractive"
 
     def aptget(*args)

Reply via email to