Postgres 9.0.1, hstore, PostGIS 1.5.2, GEOS 3.2.2 & GDAL 1.7 on Ubuntu 10.04 Lucid

by tokumine

Ubuntu 10.04 / Lucid is the latest long term release that most of us will be using for our server deployments for now. Unfortunately, it was released just before the latest big releases in the FOSS GIS world: Postgres 9 and PostGIS 1.5.

Thankfully, it’s pretty simple to install these latest versions. Here is quick rundown of the steps needed to install a great OSS server-side GIS stack with all these new toys using easy to remove .deb packages. Tested on EC2 with the latest stock 10.04 server AMI (ami-60067832).

  • Postgresql 9.0.1 + hstore NoSQL columns
  • PostGIS 1.5.2
  • GEOS 3.2.2
  • Proj 4.7
  • GDAL 1.7.2
  • Spatialite 2.4 RC4

All components with test PostGIS database example

sudo add-apt-repository ppa:pitti/postgresql
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install -y postgresql-9.0 postgresql-server-dev-9.0 postgresql-contrib-9.0 proj libgeos-3.2.2 libgeos-c1 libgeos-dev libgdal1-1.7.0 libgdal1-dev build-essential libxml2 libxml2-dev checkinstall

tar zxvf postgis-1.5.2.tar.gz && cd postgis-1.5.2/
sudo ./configure && sudo make && sudo checkinstall --pkgname postgis-1.5.2 --pkgversion 1.5.2-src --default

sudo su postgres
createdb -U postgres test_gis
createlang -dtest_gis plpgsql
psql -U postgres -d test_gis -f /usr/share/postgresql/9.0/contrib/hstore.sql  #<= hstore bootstrap, thanks to Paul Smith
psql -U postgres -d test_gis -f /usr/share/postgresql/9.0/contrib/postgis-1.5/postgis.sql
psql -U postgres -d test_gis -f /usr/share/postgresql/9.0/contrib/postgis-1.5/spatial_ref_sys.sql
psql -U postgres -d test_gis -c"select postgis_lib_version();"

If you just want PostgreSQL 9.0

sudo add-apt-repository ppa:pitti/postgresql
sudo apt-get update
sudo apt-get install postgresql-9.0

Thanks to James DeMichele & Brent Wood for feedback on the original (incorrect) article.