How to install postgres-9.1 on Ubuntu 10.04 LTS?

9.1k views Asked by At

Many months ago, I installed postgres 8.4 using the following command:

$ sudo aptitude install postgresql-8.4 postgresql-client postgresql-contrib

Now I am trying to upgrade to 9.1.

$ sudo aptitude install postgresql-9.1

There apparently is no package that matches 9.1 But it does appear to exist for apt-get. Do I have to go with apt-get?

1

There are 1 answers

2
SS Hegde On BEST ANSWER

This may help you out:

http://www.postgresql.org/docs/9.1/static/upgrading.html


or else you can follow these steps:

As root:

su - postgres
pg_dumpall > dump.sql
exit
cp ~postgres/dump.sql /root/

Now you can safely remove the postgresql-8.4 and install postgresql-9.1:

aptitude purge postgresql-8.4
aptitude install postgresql-9.1

Next check the postgresql configuration in /etc/postgresql/9.1/main. If you make any changes, make sure to restart postgres with /etc/init.d/postgresql restart.

Postgresql 9.1 is now up and running, let's import our data back into it.

su - postgres
psql < dump.sql

That's all. You're now fully upgraded to PostgreSQL 9.1

edit:

similar question was asked here:

https://askubuntu.com/questions/66194/how-do-i-migrate-my-postgres-data-from-8-4-to-9-1