wiki:UsersWikiPostGIS15Ubuntu1004src

Version 2 (modified by Mike Taves, 12 years ago) ( diff )

How to install PostGIS 1.5 on Ubuntu 10.10 LTS (lucid) from source

Prerequisites

Several components are needed, which can either be built from source or installed from pre-built packages, as shown below.

Install prerequisite packages using:

sudo apt-get install build-essential proj postgresql-8.4 postgresql-server-dev-8.4 libxml2-dev

Optional packages for testing PostGIS:

sudo apt-get install libcunit1-dev

Optional packages for building documentation:

sudo apt-get install xsltproc docbook-xsl imagemagick

(for building PDF documentation, add dblatex, but expect a large download)

Build GEOS 3.3.x

PostGIS 1.5 requires GEOS ≥ 3.1.1, however Ubuntu 10.10 only has GEOS 3.1 available in packages, so it needs to be built from source.

There are multiple ways to build GEOS, but this is the simplest:

wget http://download.osgeo.org/geos/geos-3.3.2.tar.bz2
tar xvfj geos-3.3.2.tar.bz2
cd geos-3.3.2
./configure
make
sudo make install

Build PostGIS

Download, configure, build and install:

wget http://postgis.refractions.net/download/postgis-1.5.3.tar.gz
tar xfvz postgis-1.5.3.tar.gz
cd postgis-1.5.3
./configure
make
sudo make install
sudo ldconfig

Documentation/comments

From the postgis-1.5.3 directory:

cd doc
make
sudo make install
sudo make comments-install

Template

Complete a post-install by creating a template, which can be re-used for creating multiple spatially-enabled databases. Or if you just want to make one spatially enabled database, you can modify the commands for your needs.

sudo -u postgres createdb template_postgis
sudo -u postgres createlang plpgsql template_postgis
sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql
sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis-1.5/spatial_ref_sys.sql
sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis_comments.sql
Note: See TracWiki for help on using the wiki.