Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Let's have a metapackage which depends on the following packages

Depends: A (=2),
 B (=2),
 C (=2)

Note the '=' - I want to install these particular versions, not the most recent ones.

Additionally:

B depends on A(>=1)

C depends on B(>=1) and A(>=1)

If the most recent versions of A,B,C in the repository are 2 then this works.

Since I have put version 3 of A and version 3 of B in the repo sudo apt-get install my-meta-package refuses to finish with the following info:

The following packages have unmet dependencies:
  my-meta-package: Depends: B (= 2) but 3 is to be installed
                   Depends: A (= 2) but 3 is to be installed

If I manually install versions 2 of A and B then the metapackage installs correctly, which strongly suggests that there is no hidden dependency on A3 or B3. This is not a solution for the problem as the metapackage is installed automatically on many machines.

QUESTION: What to do to make sudo apt-get install my-meta-package install versions 2,2,2?

Additionally, is there a way I could get an extended info what actually creates the need for version 3 of A and version 3 of B?

share|improve this question
    
Oh, I haven't read the whole question before answering. Can you just repackage the metapackage? –  int_ua Jun 21 '12 at 10:27
2  
@int_ua I don't understand what would repackaging the metapackage do. –  Tymek Jun 22 '12 at 7:03
1  
Apt pinning? askubuntu.com/questions/103320/… –  belacqua Aug 9 '12 at 0:39
    
@belacqua - i'm with you, but we need a solid answer that covers what happens when there are reversions and broken dependencies etc etc –  hbdgaf Aug 9 '12 at 0:42
    
Does your metapackage's control file include explicit version no of depend packages, such as (a=2), (b=2)? –  Anwar Shah Aug 9 '12 at 8:11

2 Answers 2

You have to select the particular versions to install, and install them all at the same time that you install the meta-package.

sudo apt-get install meta-package package1=2 package2=2 package3=2

Like int_ua's answer says, you can find out reverse dependencies with this:

apt-cache rdepends package

If you want to know more information about any of those packages (available versions, dependencies, and lots more), use this:

apt-cache show package

After you finish installing them, and want to keep them at those versions while doing system upgrades, you will need to use apt-pinning as suggested by belacqua.

APT pinning

The APT pinning feature allows administrators to force APT to choose particular versions of packages which may be available in different versions from different repositories. This allows administrators to ensure that packages are not upgraded to versions which may conflict with other packages on the system, or that have not been sufficiently tested for unwelcome changes. In order to do this, the pins in APT's preferences file (/etc/apt/preferences) must be modified.

share|improve this answer
    
I believe this is the correct answer, putting the = and then the package name with version –  LnxSlck Aug 9 '12 at 21:40
    
I am Tymek's colleague and this actually solves the problem. Too bad we have to reverse engineer the metapackage to make it happen. Some creative Python is in order. Thanks heaps for the answer. –  Igor Zevaka Sep 4 '12 at 6:46

You can try installing dependencies first with

sudo apt-get install package=2 where 2 is the version

You can find out what packages depend on the package with

apt-cache rdepends package

share|improve this answer
    
rdepends doesn't provide a details info about versions, right? –  Tymek Jun 21 '12 at 11:45
    
Installing dependencies first would defy having the metapackage. It is a solution, but not the one I'm looking for. –  Tymek Jun 21 '12 at 11:47
    
Note that for this to work the repositories need to have an available version of that version you specified, if they don't it will error out. –  Thomas W. Jun 21 '12 at 13:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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