I recently installed the latest release of Ubuntu, 8.10. I wanted to setup my Dell Mini to do some on-the-road Ruby development so I tried:
$ sudo apt-get install ruby
Only to find out the Ruby default for Ubuntu 8.10 is Ruby 1.8.7 which is known to have some compatibility problems with pre-Rails 2.2.2 and other Ruby gems and plugins. After removing Ruby 1.8.7 I set out to figure out the best way to get my old friend Ruby 1.8.6 up and running.
It’s about the source
It turns out we can pretty easily set the source of where Ubuntu gets it’s updates regardless of the version. Even though I have Ubuntu 8.10 installed, I can install packages from Ubuntu 8.04.
Getting started is pretty easy. The file we need to change is the sources.list file located in /etc/apt/. After backing up the file I changed the file to access the older Hardy file repositories alongside the newer Intrepid (8.10) versions. The sources.list file now looks like this:
# deb cdrom:[Ubuntu 7.10 _Gutsy Gibbon_ - Release i386 (20071016)]/ gutsy main restricted # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. # Line commented out by installer because it failed to verify: deb http://mirror.cs.umn.edu/ubuntu/ intrepid main restricted deb http://mirror.cs.umn.edu/ubuntu/ hardy main restricted # Line commented out by installer because it failed to verify: deb-src http://mirror.cs.umn.edu/ubuntu/ intrepid main restricted deb-src http://mirror.cs.umn.edu/ubuntu/ hardy main restricted ## Major bug fix updates produced after the final release of the ## distribution. # Line commented out by installer because it failed to verify: deb http://mirror.cs.umn.edu/ubuntu/ intrepid-updates main restricted deb http://mirror.cs.umn.edu/ubuntu/ hardy-updates main restricted # Line commented out by installer because it failed to verify: deb-src http://mirror.cs.umn.edu/ubuntu/ intrepid-updates main restricted deb-src http://mirror.cs.umn.edu/ubuntu/ hardy-updates main restricted ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## universe WILL NOT receive any review or updates from the Ubuntu security ## team. # Line commented out by installer because it failed to verify: deb http://mirror.cs.umn.edu/ubuntu/ intrepid universe deb http://mirror.cs.umn.edu/ubuntu/ hardy universe # Line commented out by installer because it failed to verify: deb-src http://mirror.cs.umn.edu/ubuntu/ intrepid universe deb-src http://mirror.cs.umn.edu/ubuntu/ hardy universe # Line commented out by installer because it failed to verify: deb http://mirror.cs.umn.edu/ubuntu/ intrepid-updates universe deb http://mirror.cs.umn.edu/ubuntu/ hardy-updates universe # Line commented out by installer because it failed to verify: deb-src http://mirror.cs.umn.edu/ubuntu/ intrepid-updates universe deb-src http://mirror.cs.umn.edu/ubuntu/ hardy-updates universe ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. # Line commented out by installer because it failed to verify: deb http://mirror.cs.umn.edu/ubuntu/ intrepid multiverse deb http://mirror.cs.umn.edu/ubuntu/ hardy multiverse # Line commented out by installer because it failed to verify: deb-src http://mirror.cs.umn.edu/ubuntu/ hardy multiverse deb-src http://mirror.cs.umn.edu/ubuntu/ intrepid multiverse # Line commented out by installer because it failed to verify: deb http://mirror.cs.umn.edu/ubuntu/ intrepid-updates multiverse deb http://mirror.cs.umn.edu/ubuntu/ hardy-updates multiverse # Line commented out by installer because it failed to verify: deb-src http://mirror.cs.umn.edu/ubuntu/ intrepid-updates multiverse deb-src http://mirror.cs.umn.edu/ubuntu/ hardy-updates multiverse ## Uncomment the following two lines to add software from the 'backports' ## repository. ## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. deb http://mirror.cs.umn.edu/ubuntu/ intrepid-backports main restricted universe multiverse deb http://mirror.cs.umn.edu/ubuntu/ hardy-backports main restricted universe multiverse deb-src http://mirror.cs.umn.edu/ubuntu/ intrepid-backports main restricted universe multiverse deb-src http://mirror.cs.umn.edu/ubuntu/ hardy-backports main restricted universe multiverse ## Uncomment the following two lines to add software from Canonical's ## 'partner' repository. This software is not part of Ubuntu, but is ## offered by Canonical and the respective vendors as a service to Ubuntu ## users. deb http://archive.canonical.com/ubuntu intrepid partner deb http://archive.canonical.com/ubuntu hardy partner deb-src http://archive.canonical.com/ubuntu intrepid partner deb-src http://archive.canonical.com/ubuntu hardy partner # Line commented out by installer because it failed to verify: deb http://mirror.cs.umn.edu/ubuntu/ intrepid-security main restricted deb http://mirror.cs.umn.edu/ubuntu/ hardy-security main restricted # Line commented out by installer because it failed to verify: deb-src http://mirror.cs.umn.edu/ubuntu/ intrepid-security main restricted deb-src http://mirror.cs.umn.edu/ubuntu/ hardy-security main restricted # Line commented out by installer because it failed to verify: deb http://mirror.cs.umn.edu/ubuntu/ intrepid-security universe deb http://mirror.cs.umn.edu/ubuntu/ hardy-security universe # Line commented out by installer because it failed to verify: deb-src http://mirror.cs.umn.edu/ubuntu/ intrepid-security universe deb-src http://mirror.cs.umn.edu/ubuntu/ hardy-security universe # Line commented out by installer because it failed to verify: deb http://mirror.cs.umn.edu/ubuntu/ intrepid-security multiverse deb http://mirror.cs.umn.edu/ubuntu/ hardy-security multiverse # Line commented out by installer because it failed to verify: deb-src http://mirror.cs.umn.edu/ubuntu/ intrepid-security multiverse deb-src http://mirror.cs.umn.edu/ubuntu/ hardy-security multiverse
Next up we need to create a file to tell the package manager our preferences for various packages that we might try to install. The file is /etc/apt/preferences and contain the following:
Package: ruby Pin: release a=hardy Pin-Priority: 900 Package: ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: libruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: rdoc1.8 Pin: release a=hardy Pin-Priority: 900 Package: ri1.8 Pin: release a=hardy Pin-Priority: 900 Package: libgtk2-ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: libdbd-sqlite3-ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: libopenssl-ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: libsqlite3-ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: ruby1.8-dev Pin: release a=hardy Pin-Priority: 900 Package: libdbi-ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: libatk1-ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: libpango1-ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: libatk1-ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: libgdk-pixbuf2-ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: libglib2-ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: libcairo-ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: irb1.8 Pin: release a=hardy Pin-Priority: 900 Package: libreadline-ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: rails Pin: release a=hardy Pin-Priority: 900 Package: libncurses-ruby1.8 Pin: release a=hardy Pin-Priority: 900
Once the file is in place a quick sudo apt-get update will make sure the repositories are up-to-date. Now our install of Ruby:
sudo aptitude install ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8 libreadline-ruby1.8 libruby1.8 libopenssl-ruby sqlite3 libsqlite3-ruby1.8
and it will be what we expect, 1.8.6.
Awesome – I think I’ll be trying this out this weekend, as I have an app on 8.10 that’s running into weird problems even though it was working fine on 8.04.
Awesome – I think I’ll be trying this out this weekend, as I have an app on 8.10 that’s running into weird problems even though it was working fine on 8.04.
@jeff When I saw your Tweet about Ubuntu 8.10 and Ruby 1.8.7, I wondered if you were going to have issues. I bypassed 1.8.7 altogether just for the sanity.
Let me know how it goes.
@jeff When I saw your Tweet about Ubuntu 8.10 and Ruby 1.8.7, I wondered if you were going to have issues. I bypassed 1.8.7 altogether just for the sanity.
Let me know how it goes.
Even you are using Ubuntu Intrepid Ibex 8.10, better to downgrade from Ruby 1.8.7 to 1.8.6, as usufull for more production servers for today.
I have written the article about smart downgrade by using repo from Ubuntu Hardy: railsgeek.com/…/ubuntu-8-10-dow
Even you are using Ubuntu Intrepid Ibex 8.10, better to downgrade from Ruby 1.8.7 to 1.8.6, as usufull for more production servers for today.
I have written the article about smart downgrade by using repo from Ubuntu Hardy: railsgeek.com/…/ubuntu-8-10-dow
When I started, I get this back. None of the ones I checked had anything to do with ruby, and look to be basic libs. I declined. Any notion of what should be done?
The following packages will be REMOVED:
comerr-dev{u} javascript-common{u} libjs-prototype{u} libkadm55{u} libkrb5-dev{u} libossp-uuid15{u} libpq-dev{u}
vim-gui-common{u} vim-runtime{u} wwwconfig-common{u}
When I started, I get this back. None of the ones I checked had anything to do with ruby, and look to be basic libs. I declined. Any notion of what should be done?
The following packages will be REMOVED:
comerr-dev{u} javascript-common{u} libjs-prototype{u} libkadm55{u} libkrb5-dev{u} libossp-uuid15{u} libpq-dev{u}
vim-gui-common{u} vim-runtime{u} wwwconfig-common{u}