Ubuntu – Installation of PostgreSQL 8.2 with PostgreSQL 8.4 on Ubuntu 10.10

postgresqlUbuntu

On an Ubuntu Server, version 8.4 of PostgreSQL Server is already installed.
I have to install 8.2 on the same server.

I would prefer to install from a .DEB instead of compiling from source.

Best Answer

You can use hardy Ubuntu repository:

  • sudo echo "deb http://ru.archive.ubuntu.com/ubuntu/ hardy universe" > /etc/apt/sources.list.d/hardy.list
  • sudo apt-get update
  • cd && apt-get source postgresql-8.2
  • sudo apt-get build-dep postgresql-8.2
  • sudo apt-get install libreadline-dev
  • cd postgresql-8.2-8.2.7/
  • vi debian/control, and change "libreadline5-dev" to "libreadline-dev"
  • dpkg-buildpackage
  • cd && sudo dpkg -i postgresql-8.2_8.2.7-1_i386.deb postgresql-client-8.2_8.2.7-1_i386.deb postgresql-contrib-8.2_8.2.7-1_i386.deb
  • rm /etc/apt/sources.list.d/hardy.list

End:

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 10.10
Release:    10.10
Codename:   maverick
# pg_lsclusters 
Version Cluster   Port Status Owner    Data directory                     Log file
8.2     main      5433 online postgres /var/lib/postgresql/8.2/main       /var/log/postgresql/postgresql-8.2-main.log
8.4     main      5432 online postgres /var/lib/postgresql/8.4/main       /var/log/postgresql/postgresql-8.4-main.log