Installing Postgis in Ubuntu 18.04 with libgdal26-incompatibility with libgdal20?

Solution 1:

There is a conflict of dependency here. One solution is to wait until the maintainers update the dependencies (or maybe upgrade to newer 20.04 LTS of Ubuntu).

Another solution is to compile PostGIS from source, which isn't very complex. Using the latest version of PostGIS as an example, you can:

wget https://download.osgeo.org/postgis/source/postgis-3.1.2.tar.gz
tar xf postgis-3.1.2.tar.gz
cd postgis-3.1.2
./configure
make && sudo make uninstall && sudo make install

then restart the server.

Solution 2:

I had a similar issue. Without having to update the OS, I had to:

  1. Remove the distribution cmake and install the latest one, 3.21.3.

  2. Compile/Install CGAL 5.3.

  3. Compile/Install SFCGAL 1.4 (the latest cmake was needed to compile this).

  4. Compile/Update GEOS to 3.8.2.

  5. Install the following libs:

    sudo apt install protobuf-c-compiler libjsoncpp-dev libprotobuf-dev libprotobuf-c-dev libxml2-dev
    

    This is not a complete list of dependencies but is a pretty good start.