My server is running Ubuntu Hardy and Ruby 1.8.6 installed using aptitude. I'd like to upgrade to Ruby 1.8.7 but, unfortunately, the Ruby package includes Ruby 1.8.7 starting from Ubuntu Intrepid.

I read a couple of tutorials about how to upgrade to Ruby 1.8.7 and I found at least 3 different way to accomplish this task:

  • backports
  • installation from source
  • installation from source and multiple versions

I'm a bit confused. How do you recommend to upgrade to Ruby 1.8.7 taking into consideration I don't need multiple Ruby versions on the same server? I'd like to cleanly replace the existing Ruby 1.8.6 with Ruby 1.8.7.


As Jeff made me notice that Ruby 1.8.7 has not been backported yet, the other only solution that comes to my mind is to use the PPA of the team packaging Ruby.

There you can find both Ruby version and version, should you prefer.

If you don't know how to configure ubuntu to use a PPA, the instructions are also on the linked page (click on Not using Ubuntu 9.10 (karmic)? under the "Adding this PPA to your system" section.

Hope this helps! :)

  • Nice find! This seems like a nice and clean way to do it. – Jeff Snider Nov 15 '09 at 19:27

This is the one place where I think APT really sucks. To be honest, I'd suggest taking the lazy way out and just install the debs manually.

cd /tmp
wget http://archive.ubuntu.com/ubuntu/pool/main/r/ruby1.8/libruby1.8_1.8.7.174-2_i386.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/r/ruby1.8/ruby1.8_1.8.7.174-2_i386.deb
sudo dpkg -i libruby1.8_1.8.7.174-2_i386.deb ruby1.8_1.8.7.174-2_i386.deb
sudo apt-get install ruby

This won't work for just any package, but ruby seems to be pretty clean as far as dependencies go. No promises that you won't run into some obscure issue with other packages you might install from apt though.

  • One caveat with this method: You will not get automatic updates for ruby after this. If there's a security release, APT will not install it for you. – Jeff Snider Nov 14 '09 at 17:36
  • I'm writing this more than a year after the OP, and trying the wgets above i get a 404 in both cases. Is there an updated url for the ruby 1.8.7 debs? – Max Williams Dec 20 '10 at 9:33
  • Take a look at mac's answer above. The link he provided is still valid. The debs I linked to were for one of the short term ubuntu releases rather than an LTS. Alternatively, you can back up one directory in those links and browse for the debs. archive.ubuntu.com/ubuntu/pool/main/r/ruby1.8 It looks like is the latest. – Jeff Snider Dec 20 '10 at 17:23

If you want to use the repos, and therefore being able to at least know when an update is available, you might choose to use the backport repository. There is a technique, called pinning that allows you to enable the whole repository but install/upgrade only certain packages. Since the ubuntu wiki does a better job than I could at explaining how to do that, I leave you to read it! :)

If you choose to go with the suggestion made by Jeff Snider, than you might wish to run:

sudo apt-get -f update

The -f stands for --fix-broken and what it does is to attempt fixing broken dependencies of already installed packages.


  • This would be helpful if ruby were in the backports repository, but it's not. Backports is a managed repository that only contains packages that have been requested and the ubuntu team deems appropriate. weppos would have to request ruby 1.8.7 be added to hardy-backports, then wait for them to add it. – Jeff Snider Nov 15 '09 at 16:56
  • Jeff, you are right, sorry I did not notice it myself. See my other answer to this same question. – mac Nov 15 '09 at 19:01

Another option is to use the brightbox packages for rubyee.

Below is quoted from Ben Arblaster's post

If you’re on a Hardy based Brightbox, just create or edit /etc/apt/sources.list.d/brightbox-rubyee.list to contain the rubyee-testing component like so:

deb http://apt.brightbox.net/ hardy rubyee-testing

Finally, update and upgrade libruby1.8:

sudo apt-get update

sudo apt-get install libruby1.8 irb1.8 libopenssl-ruby1.8 libreadline-ruby1.8 rdoc1.8 ruby

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.