How to install PostgreSQL on Ubuntu 12.04

Update your system with this PPA (Personal Package Archives) so you can install an up-to-date version of PostgreSQL:

$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:pitti/postgresql
$ sudo apt-get update

And now install PostgreSQL and the dev packages:

$ sudo apt-get install postgresql libpq-dev

That’s all. You can check your new PostgreSQL version:

$ psql -V
psql (PostgreSQL) 9.1.6
contains support for command-line editing
This entry was posted in system administration. Bookmark the permalink.