[GIS] How to install PostGIS on Linux Mint 14

linuxpostgispostgresql

I am trying to install PostGIS on Linux Mint 14 KDE. First thing I tried was to install PostgreSQL using "sudo apt-get install postgresql". I was successful doing that. I then did "sudo apt-get install postgis" and it installed something, but when I try to use it, say following the tutorials on the postGIS site, it won't recognize any command I type and the tutorial will refer me back to the installation section.

So, I assume the Linux Mint PostGIS package is somehow broken or I am missing some key step. So, I decided to install PostGIS by building from source. After downloading many different dependencies I still can't get it to compile. I can successfully do ./configure. But it fails on 'sudo make' with the following error:

make -C liblwgeom 
make[1]: Entering directory `/home/user/Downloads/postgis-1.4.2/liblwgeom'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/user/Downloads/postgis-1.4.2/liblwgeom'
make -C postgis 
make[1]: Entering directory `/home/user/Downloads/postgis-1.4.2/postgis' gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC -pie -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -fpic -I/usr/include  -I../liblwgeom -I. -I. -I/usr/include/postgresql/9.1/server -I/usr/include/postgresql/internal -D_FORTIFY_SOURCE=2 -DLINUX_OOM_ADJ=0 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/tcl8.5  -c -o lwgeom_accum.o lwgeom_accum.c
lwgeom_accum.c: In function ‘pgis_geometry_accum_transfn’:
lwgeom_accum.c:110:52: error: ‘WindowAggState’ has no member named ‘wincontext’
lwgeom_accum.c: In function ‘PGISDirectFunctionCall1’:
lwgeom_accum.c:304:61: error: macro "InitFunctionCallInfoData" requires 6 arguments, but only 5 given
lwgeom_accum.c:304:9: error: ‘InitFunctionCallInfoData’ undeclared (first use in this function)
lwgeom_accum.c:304:9: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [lwgeom_accum.o] Error 1
make[1]: Leaving directory `/home/user/Downloads/postgis-1.4.2/postgis'
make: *** [postgis] Error 2

Is there some easier way to do this or a good and up to date tutorial out there?

Best Answer

I see that Linux Mint 14 is based on Ubuntu 12.10, which probably offers a similar set of packages. If you'd like a little older (but still good) PostGIS 1.5, try installing from packages:

sudo apt-get install postgresql-9.1-postgis

If you want a newer PostGIS 2.0, you will need to build it from source. The reason why your build failed is that you were using a really old PostGIS 1.4, which does not work with PostgreSQL 9.1.

Try using PostGIS 2.0 source build instructions for Ubuntu 12.10.