Skip to content

Instantly share code, notes, and snippets.

View bitrut's full-sized avatar

Paweł Kowalski bitrut

View GitHub Profile
@bitrut
bitrut / gist:3135780
Created July 18, 2012 11:59 — forked from rolo/gist:1481128
Install Postgres 9.1, PostGIS and create PostGIS template on a clean Ubuntu 12.04 LTS
#!/bin/bash
sudo apt-get -y install postgresql-9.1 postgresql-server-dev-9.1 postgresql-client-9.1 postgresql-9.1-postgis
sudo su postgres -c'createdb -E UTF8 -U postgres template_postgis'
sudo su postgres -c'createlang -d template_postgis plpgsql;'
sudo su postgres -c'psql -U postgres -d template_postgis -c"CREATE EXTENSION hstore;"'
sudo su postgres -c'psql -U postgres -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql'
sudo su postgres -c'psql -U postgres -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-1.5/spatial_ref_sys.sql'
sudo su postgres -c'psql -U postgres -d template_postgis -c "select postgis_lib_version();"'