3

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.

Zoredache
  • 133,737

4 Answers4

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 1.8.7.22 and version 1.9.0.2, 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! :)

mac
  • 500
1

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

russellkt
  • 175
1

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.

Jeff Snider
  • 3,292
1

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.

HTH!

mac
  • 500