Ruby 1.8.6 en Ubuntu 8.10

Como os comenté recientemente la última versión de Ubuntu viene con Ruby 1.8.7, versión que no es del todo compatible con rails y que puede generar problemas en nuestros antiguos proyectos, por ello os voy a contar como bajar a la versión 1.8.6.
Primero borramos la versión de ruby 1.8.7 de nuestro sistema, lo podeis hacer desde synaptic para que sea más facil, buscar por ruby y eliminar los paquetes que vienen instalados por defecto.

Luego sustituiremos nuestros repositorios /etc/apt/sources.list por el de hardy y nos crearemos un archivo /etc/apt/preferences para que cuando recuperemos los repositorios de Intrepid no nos actualice de nuevo ruby.

Nos hacemos una copia de seguridad de los repositorios de Intrepid
sudo cp /etc/apt/source.list /etc/apt/source2.list

Ahora editamos nuestro source.list y lo cambiamos por este de Hardy

/etc/apt/source.list
# Paquetes de Ubuntu (GPG key: 437D05B5)
deb http://archive.ubuntu.com/ubuntu hardy main restricted
deb http://archive.ubuntu.com/ubuntu hardy-updates main restricted
deb http://archive.ubuntu.com/ubuntu hardy-security main restricted
deb http://archive.ubuntu.com/ubuntu hardy-proposed main restricted
deb-src http://archive.ubuntu.com/ubuntu hardy main restricted
deb-src http://archive.ubuntu.com/ubuntu hardy-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu hardy-security main restricted
deb-src http://archive.ubuntu.com/ubuntu hardy-proposed main restricted
# Paquetes de la comunidad de Ubuntu (GPG key: 437D05B5)
deb http://archive.ubuntu.com/ubuntu hardy universe multiverse
deb http://archive.ubuntu.com/ubuntu hardy-updates universe multiverse
deb http://archive.ubuntu.com/ubuntu hardy-security universe multiverse
deb http://archive.ubuntu.com/ubuntu hardy-proposed universe multiverse
deb-src http://archive.ubuntu.com/ubuntu hardy universe multiverse
deb-src http://archive.ubuntu.com/ubuntu hardy-updates universe multiverse
deb-src http://archive.ubuntu.com/ubuntu hardy-security universe multiverse
deb-src http://archive.ubuntu.com/ubuntu hardy-proposed universe multiverse
# Paquetes "backports" de Ubuntu (GPG key: 437D05B5)
deb http://archive.ubuntu.com/ubuntu hardy-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu hardy-backports main restricted universe multiverse
# Repositorios comeriales de Canonical (Alojados en los servidores de Canonical, no los de Ubuntu)
deb http://archive.canonical.com/ubuntu hardy partner
deb http://archive.ubuntu.com/ubuntu hardy-security main restricted
deb http://archive.ubuntu.com/ubuntu hardy-proposed main restricted
deb-src http://archive.ubuntu.com/ubuntu hardy main restricted
deb-src http://archive.ubuntu.com/ubuntu hardy-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu hardy-security main restricted
deb-src http://archive.ubuntu.com/ubuntu hardy-proposed main restricted
#Paquetes de la comunidad de Ubuntu (GPG key: 437D05B5)
deb http://archive.ubuntu.com/ubuntu hardy universe multiverse
deb http://archive.ubuntu.com/ubuntu hardy-updates universe multiverse
deb http://archive.ubuntu.com/ubuntu hardy-security universe multiverse
deb http://archive.ubuntu.com/ubuntu hardy-proposed universe multiverse
deb-src http://archive.ubuntu.com/ubuntu hardy universe multiverse
deb-src http://archive.ubuntu.com/ubuntu hardy-updates universe multiverse
deb-src http://archive.ubuntu.com/ubuntu hardy-security universe multiverse
deb-src http://archive.ubuntu.com/ubuntu hardy-proposed universe multiverse
# Paquetes "backports" de Ubuntu (GPG key: 437D05B5)
deb http://archive.ubuntu.com/ubuntu hardy-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu hardy-backports main restricted universe multiverse
# Repositorios comeriales de Canonical (Alojados en los servidores de Canonical, no los de Ubuntu)
deb http://archive.canonical.com/ubuntu hardy partner

Nos creamos el archivo de preferencias:

/etc/apt/preferences
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


Actualizamos: sudo apt-get update

Y acto seguido nos vamos a synaptic e instalamos ruby 1.8 irb ruby1.8-dev y todo lo que necesitemos.

Tras la instalación sólo nos queda recuperar nuestro source.list de Intrepid:

sudo cp /etc/apt/source2.list /etc/apt/source.list
sudo rm /etc/apt/source2.list

Y listo!

6 comentarios:

elliott lau dijo...

hola, oye como se llama el tipo de letra que tienes en el titulo de las ventanas???

PsYducKbug dijo...

Hola elliott, se llama purisa ;)
Salu2

Nany_09 dijo...

al hacer el apt-get update me da el siguiente error:

E: Vaya, excedió el número de descripciones que este APT es capaz de manejar.
E: Problem with MergeList /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_intrepid_universe_binary-i386_Packages
E: Las listas de paquetes o el archivo de estado no se pueden analizar sintácticamente o abrir.
E: _cache->open() failed, please report.

W: Duplicate sources.list entry http://archive.ubuntu.com hardy/universe Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_hardy_universe_binary-i386_Packages)
W: Duplicate sources.list entry http://archive.ubuntu.com hardy/universe Translation-es (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_hardy_universe_i18n_Translation-es)
W: Duplicate sources.list entry http://archive.ubuntu.com hardy/multiverse Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_hardy_multiverse_binary-i386_Packages)
W: Duplicate sources.list entry http://archive.ubuntu.com hardy/multiverse Translation-es (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_hardy_multiverse_i18n_Translation-es)
W: Duplicate sources.list entry http://archive.ubuntu.com hardy-updates/universe Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_hardy-updates_universe_binary-i386_Packages)
W: Duplicate sources.list entry http://archive.ubuntu.com hardy-updates/multiverse Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_hardy-updates_multiverse_binary-i386_Packages)
W: Duplicate sources.list entry http://archive.ubuntu.com hardy-security/main Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_hardy-security_main_binary-i386_Packages)
W: Duplicate sources.list entry http://archive.ubuntu.com hardy-security/restricted Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_hardy-security_restricted_binary-i386_Packages)
W: Duplicate sources.list entry http://archive.ubuntu.com hardy-security/universe Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_hardy-security_universe_binary-i386_Packages)
W: Duplicate sources.list entry http://archive.ubuntu.com hardy-security/multiverse Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_hardy-security_multiverse_binary-i386_Packages)
W: Duplicate sources.list entry http://archive.ubuntu.com hardy-proposed/main Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_hardy-proposed_main_binary-i386_Packages)
W: Duplicate sources.list entry http://archive.ubuntu.com hardy-proposed/main Translation-es (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_hardy-proposed_main_i18n_Translation-es)
W: Duplicate sources.list entry http://archive.ubuntu.com hardy-proposed/restricted Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_hardy-proposed_restricted_binary-i386_Packages)
W: Duplicate sources.list entry http://archive.ubuntu.com hardy-proposed/restricted Translation-es (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_hardy-proposed_restricted_i18n_Translation-es)
W: Duplicate sources.list entry http://archive.ubuntu.com hardy-proposed/universe Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_hardy-proposed_universe_binary-i386_Packages)
W: Duplicate sources.list entry http://archive.ubuntu.com hardy-proposed/universe Translation-es (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_hardy-proposed_universe_i18n_Translation-es)
W: Duplicate sources.list entry http://archive.ubuntu.com hardy-proposed/multiverse Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_hardy-proposed_multiverse_binary-i386_Packages)
W: Duplicate sources.list entry http://archive.ubuntu.com hardy-proposed/multiverse Translation-es (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_hardy-proposed_multiverse_i18n_Translation-es)
W: Duplicate sources.list entry http://archive.ubuntu.com hardy-backports/main Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_hardy-backports_main_binary-i386_Packages)
W: Duplicate sources.list entry http://archive.ubuntu.com hardy-backports/restricted Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_hardy-backports_restricted_binary-i386_Packages)
W: Duplicate sources.list entry http://archive.ubuntu.com hardy-backports/universe Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_hardy-backports_universe_binary-i386_Packages)
W: Duplicate sources.list entry http://archive.ubuntu.com hardy-backports/multiverse Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_hardy-backports_multiverse_binary-i386_Packages)
W: Duplicate sources.list entry http://archive.canonical.com hardy/partner Packages (/var/lib/apt/lists/archive.canonical.com_ubuntu_dists_hardy_partner_binary-i386_Packages)


¿¿alguien me puede ayudar??

Anónimo dijo...

Hola nany_09 el archivo de source.list, unicamente contiene la lista que pone en el post, verdad? fijate que no tenga ninguna repetición y que esté todo igual, por otro lado yo probaría a purgar la caché del apt por si acaso y volver a intentarlo:

sudo apt-get purge

dodger dijo...

Lo primero, muchas gracias por la entrada, llevo 2 días volviendome loco con un proyecto de RoR que había dejado de funcionar.

Y lo segundo, Nany_09 tiene razón. El sources.list tiene unas cuantas líneas duplicadas (supongo que habrás pegado dos veces). Sobra desde la segunda vez que aparece "#Paquetes de la comunidad de Ubuntu (GPG key: 437D05B5)"

Un saludo

Михайлов Анатолий dijo...

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:
http://railsgeek.com/2008/11/27/ubuntu-8-10-downgrade-ruby-1-8-7-to-1-8-6