Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question
add comment

4 Answers

up vote 1 down vote accepted
+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.

share|improve this answer
    
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 '12 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> –  Evan Carroll Feb 8 '12 at 18:07
add comment

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

share|improve this answer
    
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 '12 at 20:04
add comment

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.

share|improve this answer
    
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 '12 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 '12 at 18:53
add comment

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.

share|improve this answer
add comment

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.