2

I'm using a version of rubygems needed for running one of the application of my server installed this way :

dpkg --install /tmp/rubygems1.8_1.3.7-2_all.deb

At each usage of it, aptitude want to roll back to the old version of rubygems (stored in the repositories.

How can I tell aptitude to ignore this problem ?

I would like a command line solution since I'm using a server (Ubutun 10.04), so this is not a duplicate of : Tell aptitude to ignore broken package

4 Answers 4

1
+50

Just install the version of gems required outside of apt. This is actually better too, because it'll be in /usr/local/bin (thing you installed) rather than /usr/bin which is supposed to be for the distribution (things built in the repository you're downloading from). In this case the distribution is obviously trying to reject your version of gems.

In addition things installed with your version of Ruby Gems will probably be in a different directory higher up in the include-path like /usr/local/share rather than /usr/lib. This means that when you install things with /usr/local/bin/gem it'll go to a special place that won't interfere with things that /usr/bin/gem installs.

2
  • Thanks. What will happen since aptitude will need a version of rubygems for some dependencies ? How can I tell the system to use my version as default ?
    – AsTeR
    Feb 8, 2012 at 10:24
  • Let aptitude use the version the package maintainer requested. When you want to install something that requires a different version of gems, simply do so outside of aptitude by explicitly specifying the path to the version of gems you installed: /usr/local/bin/gem install <package> Feb 8, 2012 at 18:07
0

I hold packages using aptitude hold <package>. I'm not sure if it works for preventing rollbacks, too, but it's worth a try.

You can also use dpkg: echo “<package> hold” | dpkg --set-selections

Reference

1
  • Thanks but this doesn't work since some dependences are not satisfied : instead of offering to restore the repository package aptitude now offer to remove dependent packages (which is bad as you can guess)
    – AsTeR
    Feb 5, 2012 at 20:04
0

If I were you, I would recompile (modify) the package so it doesn't break the dependencies.

Because I don't think there's an acceptable way to tell dpkg/apt to be happy with unmet/broken dependencies... as that's basically what they were created for.

2
  • That's not the "easy to setup" solution, even if their build for checking dependencies I would really enjoy having a warning that having the duty to destroy my environment at each new package installation.
    – AsTeR
    Feb 6, 2012 at 18:25
  • While I agree that's not easy solution... I don't exactly know what is. Seems to me that you're trying to solve the underlying issue in a wrong way. Perhaps adding more detail would help to devise a better way? Btw, how about RVM for Ruby package management? Might save you some trouble with Deb package management (while still allowing relatively easy replication).
    – Wejn
    Feb 6, 2012 at 18:53
0

You can use equivs to create dummy packages which provide the missing packages.

Of course, this only works, if there are no conflicts between the installed packages.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .