I've been around this APT pinning process a couple of times and I still can't get it to do what I want.

Currently I am running Ubuntu Karmic. I have no default release set, so Karmic is defaulting to priority 500. I've added Ubuntu Lucid to my sources and in the preferences file set it's priority to 400.

Now say I want to install the latest Firefox-3.5 from Lucid, as far as I know I have two options.

1: sudo apt-get install firefox-3.5/lucid

This will only pull dependencies from Karmic and will generally fail because some supporting package doesn't have a high enough version in Karmic.

2: sudo apt-get install firefox-3.5 -t lucid

This will pull all required dependencies from Lucid, even those that could have been met from Karmic.

What I want is a third option that uses Karmic where it can and only uses Lucid where it must.

Now of course this can be done by hand by applying option 1 recursively to every unmet dependency, but that quickly gets very tedious.

Is there someway I can manipulate the priorities and options to achieve what I want?


And the answer is... Aptitude.

The config as stated in the question is fine. But where "apt-get install firefox-3.5/lucid" complains of unmet dependencies "aptitude install firefox-3.5/lucid" complains and then offers to correct the problem and in every example I've tried the fix is exactly the behavior I'm looking for.

Hugin on my current system makes a good example:

'apt-get install hugin -t lucid' wants to install 27 packages, all from Lucid, most of them libraries.

"apt-get install hugin/lucid" complains that hugin has unmet dependencies

"aptitude install hugin/lucid" offers to install 3 packages from Lucid and everything else from Karmic

$ aptitude install hugin/lucid
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Initializing package states... Done
The following packages are BROKEN:
The following NEW packages will be installed:
  autopano-sift{a} binfmt-support{a} cli-common{a} enblend{a} enfuse{a} 
  freeglut3{a} libboost-thread1.38.0{a} libgdiplus{a} libglade2.0-cil{a} 
  libglib2.0-cil{a} libgtk2.0-cil{a} libimage-exiftool-perl{a} 
  libmono-cairo2.0-cil{a} libmono-corlib2.0-cil{a} 
  libmono-i18n-west2.0-cil{a} libmono-security2.0-cil{a} 
  libmono-sharpzip2.84-cil{a} libmono-system2.0-cil{a} libpano13-1{a} 
  libplot2c2{a} mono-2.0-gac{a} mono-gac{a} mono-runtime{a} 
0 packages upgraded, 24 newly installed, 0 to remove and 0 not upgraded.
Need to get 11.6MB of archives. After unpacking 37.1MB will be used.
The following packages have unmet dependencies:
  hugin: Depends: hugin-tools (= 2009.2.0+dfsg-2ubuntu1) but it is not installable
The following actions will resolve these dependencies:

Install the following packages:
hugin-data [2009.2.0+dfsg-2ubuntu1 (lucid)]
hugin-tools [2009.2.0+dfsg-2ubuntu1 (lucid)]
libpano13-bin [2.9.14-2 (karmic, lucid)]

Score is -17

Accept this solution? [Y/n/q/?]
  • 1
    It's not always this obvious. I wanted git from testing while keeping the system on stable. It just needed libc6 and git-man from testing. Aptitude proposed first to remove etckeeper (which btw is from testing, so I'm confident that it's happy with that git version). When rejecting that, I noticed aptitude has other strategies. By entering '.' you can go to the next solution. Well I cycled through about 20 ludicrous propositions mostly proposing me to install bzr or mercurial with a bunch of python and js packages before it came to just propose to update the dependencies. – ufotds Apr 19 '14 at 7:55

Ubuntu recommends doing source builds over pinning. For example, first build the source dependencies:

sudo apt-get build-dep firefox-3.5

Then build the lucid version on your karmic machine:

sudo apt-get -b source -t lucid firefox-3.5

It's not exactly what you're asking for, but it's not tedious.

  • won't this still get dependencies from lucid even when they could be satisfied from karmic? – Gordon Wrigley Nov 25 '09 at 5:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.