Log In   View a printable version of the current page.
  Dashboard > [fleXive] > ... > How-Tos > Postgres 9.x installation in Ubuntu

Added by Markus Plesser, last edited by Markus Plesser on Apr 10, 2012  (view change)
Labels: 
(None)

Postgres 9.x installation in Ubuntu

Up to and including Ubuntu 10.10 Postgres version 9 is not supported/offered in the repositories.
[fleXive] however works fine with Postgres 9 and it is the recommended Postgres version to use.

Open a terminal console and switch to root (sudo -s) and the enter the following commands:

add-apt-repository ppa:pitti/postgresql
sudo apt-get remove postgresql-8.4 postgresql-client-8.4 postgresql-common pgadmin3 pgadmin3-data
sudo apt-get install postgresql-9.0 postgresql-client-9.0

Now change the postgres user password (still running as root):

su postgres
psql -d postgres -U postgres

In the psql shell enter:

alter user postgres with password 'a';
\q

You should now be ready to use Postgres 9

If you need pgAdmin (which does currently not support prebuilt ubuntu packages) you'll have to compile and install it by hand:
First, create a source directory and grab the tarball (adjust version if needed):

wget http://wwwmaster.postgresql.org/redir/407/h/pgadmin3/release/v1.12.1/src/pgadmin3-1.12.1.tar.gz
tar xvfz pgadmin3-1.12.1.tar.gz
cd pgadmin3-1.12.1
./configure
make
sudo make install

configure will most likely complain about a missing pg_config.
To fetch it and grab other possible missing dependencies, open a terminal console and type:

sudo apt-get install postgresql-server-dev-9.0 libwxbase2.8-0 libwxbase2.8-dev libxml2 libxml2-dev libxml2-utils libxslt1.1 libxslt1-dev

Upgrading to Ubuntu 10.10

Make sure to re-enable the repository ppa:pitti/postgresql as the upgrade process will disable it.
In case you get errors when starting postgres complaining about SHMMAX add a file /etc/sysctl.d/90-postgres.conf containing:

kernel.shmmax = 41943040

Or adjust to a size until everything is working fine again.
See this bug for further information.

Anonymous

I am trying to install pgadmin3 on an ubuntu lucid client without installing the server. I already have a postgresql 9 server up and running that I need to work with. The install fails because the server is not present. Is there another way to install just pgadmin3 from the tar on ubuntu 10.4 lucid?

Reply To This

I dont think so as the build process needs access to some libs from the server

Reply To This
Anonymous

Great Man! Solved my problem!

Reply To This
Anonymous

Also had to add libwxgtk2.8-dev in order to compile pgadmin (on Mint 11)

Reply To This
Anonymous

Great article, thank you again for wtiring.

Reply To This
Add Comment
Site running on a free Atlassian Confluence Open Source Project License granted to [fleXive] . Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.6.1 Build:#916 Nov 09, 2007) - Bug/feature request - Contact Administrators