[GIS] How to install PostgreSQL 9.2 with PostGIS 2.0 on Ubuntu 11.10 (or higher)

postgispostgresqlUbuntu

I have read this question: https://dba.stackexchange.com/questions/25033/install-postgis-v2-for-postgresql-v9-2, but it didn't resolve my problem.

I added the PostgreSQL backports PPA and installed the postgresql-9.2 package, but there is no package for PostGIS.

Best Answer

How to Get Started with PostGIS 2.0 on Ubuntu 12.04 (precise)

(only tested on a Oracle VM) see Migrating to Linux from Windows previous install.

sudo apt-get install python-software-properties
sudo apt-add-repository ppa:sharpie/for-science
sudo apt-add-repository ppa:sharpie/postgis-stable
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install postgresql-9.2-postgis2 

Then build

http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS20Ubuntu1204 (replace postgresql-9.1 with postgresql-9.2)