Dienstag, 17. September 2013

Build and install latest PostGIS in Ubuntu Linux

If you need to stick with the latest PostGIS version for your PostgreSQL-database, you either have to find a suitable PPA or simply build the extension yourself, because Ubuntu's PostGIS version is out-of-date. Instead of using 3rd party PPAs, I recommend to build it yourself the following way:

  1. Install the prerequisite packages:

    sudo apt-get install packaging-dev postgresql postgresql-server-dev-9.1 libxml2-dev libgeos-dev libproj-dev libgdal-dev

  2. Download the sources (e.g. for PostGIS 2.1.0):

    wget http://download.osgeo.org/postgis/source/postgis-2.1.0.tar.gz

  3. Extract the sources and go into extraction folder:

    tar xvzf postgis-2.1.0.tar.gz; cd postgis-2.1.0

  4.  Configure the sources

    ./configure

  5. Compile PostGIS

    make

  6. Install the compiled PostGIS extension

    sudo make install

  7. Use PostGIS within PostgreSQL:

    CREATE EXTENSION postgis;
     
Now you can build and control the update of your PostGIS versions by yourself.

Keine Kommentare:

Kommentar veröffentlichen