I am trying to install PostGIS on top of PostgreSQL 13. I have already quite a GIS ecosystem in place, and run GDAL 3.0.4.
> dpkg -l | grep gdal
ii gdal-bin 3.0.4+dfsg-1~bionic0
ii gdal-data 3.0.4+dfsg-1~bionic0
ii libgdal-dev 3.0.4+dfsg-1~bionic0
ii libgdal26 3.0.4+dfsg-1~bionic0
ii python3-gdal 3.0.4+dfsg-1~bionic0
> dzdo apt-get install postgis postgresql-13-postgis-3
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
postgis : Depends: libgdal20 (>= 2.0.1) but it is not going to be installed
postgresql-13-postgis-3 : Depends: libgdal20 (>= 2.0.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Odd given that PostGIS is advertised to work best with GDAL 3... but fine, I'll compile it myself.
> wget https://download.osgeo.org/postgis/source/postgis-3.1.4.tar.gz
> tar xf postgis-3.1.4.tar.gz
> cd postgis-3.1.4
> ./configure --without-protobuf
> make && dzdo make uninstall && dzdo make install
make
is failing when building elements related to raster2pgsql:
make[2]: Entering directory '/home/USER/postgis-3.1.4/raster/loader'
/bin/bash ../../libtool --mode=link gcc -std=gnu99 -g -O2 -fno-math-errno -fno-signed-zeros -fPIC -DPIC -I../rt_core -I../../liblwgeom -I/usr/include/gdal -I/home/USER/anaconda3/include ../rt_core/librtcore.a raster2pgsql.o -lm -static ../../liblwgeom/liblwgeom.la -L/usr/lib -lgdal -L/home/USER/anaconda3/lib -lgeos_c -lc -o raster2pgsql
libtool: link: gcc -std=gnu99 -g -O2 -fno-math-errno -fno-signed-zeros -fPIC -DPIC -I../rt_core -I../../liblwgeom -I/usr/include/gdal -I/home/USER/anaconda3/include raster2pgsql.o -o raster2pgsql ../rt_core/librtcore.a ../../liblwgeom/.libs/liblwgeom.a -lm -L/home/USER/anaconda3/lib -lproj -ljson-c -L/usr/lib -lgdal -lgeos_c -lc
//usr/lib/x86_64-linux-gnu/libgeotiff.so.5: undefined reference to `_TIFFmemcpy@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to `TIFFReadDirectory@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to `TIFFClientdata@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libgeotiff.so.5: undefined reference to `_TIFFrealloc@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libgeotiff.so.5: undefined reference to `_TIFFmemset@LIBTIFF_4.0'
/usr/lib/libgdal.so: undefined reference to `TIFFLastDirectory@LIBTIFF_4.0'
(...) many other lines with the same reference to @LIBTIFF_4.0
collect2: error: ld returned 1 exit status
Makefile:84: recipe for target 'raster2pgsql' failed
make[2]: *** [raster2pgsql] Error 1
make[2]: Leaving directory '/home/USER/postgis-3.1.4/raster/loader'
Makefile:35: recipe for target 'rtloader' failed
make[1]: *** [rtloader] Error 2
make[1]: Leaving directory '/home/USER/postgis-3.1.4/raster'
GNUmakefile:22: recipe for target 'all' failed
make: *** [all] Error 1
The error suggest some missing libtiff4
. However, when trying to install it:
> dzdo apt-get install libtiff4
E: Unable to locate package libtiff4
> dzdo apt-get install libtiff4-dev
Package libtiff4-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
libtiff5-dev:i386 libtiff5-dev
E: Package 'libtiff4-dev' has no installation candidate
> dzdo apt-get install libtiff5-dev
libtiff5-dev is already the newest version (4.0.9-5).
libtiff
seems to be installed, in its version 5 though. When examining the possibilities to install libgdal20
with aptitude
, the proposed solutions will remove a lot of the GIS packages I am using, so this is not really an option. I am not sure how to proceed.. any help is appreciated!