I'm compiling PostGIS 2.5 from source on Ubuntu Server 18.04

The server had no internet connection due to client requirements, so I've been following PostGIS 2.5.1dev Manual, 2.4. Compiling and Install from Source: Detailed Steps ( https://postgis.net/docs/manual-2.5/postgis_installation.html#PGInstall ).

It's required to install (compile from source) the next packages:

  1. Proj4 reprojection library, version 4.9.0 or greater.
  2. GEOS geometry library, version 3.5 or greater.
  3. LibXML2, version 2.5.x or higher.
  4. JSON-C, version 0.9 or higher.
  5. GDAL, version 1.8 or higher.

Everything works fine after typical compiling instructions:

make install 

Then I compile PostGIS again with typical instructions:

make install 

In order to check if everything is working, I connect to my DB:

sudo -u postgres psql postgres
postgres=# \c testdb
testdb=# \CREATE EXTENSION postgis;

And then... PostGIS ERROR: could not load library "/usr/lib/postgresql/10/lib/postgis-2.5.so": libproj.so.13: cannot open shared object file: No such file or directory.

As far as I understand, the problem is with libproj so I've compiled again, but had no success.

Did I miss something?

2 Answers 2


If you did not install postgis in /usr, then this error is normal.

You need to configure ldconfig to link you compiled libs. You could export LD_LIBRARY_PATH=/opt/postgres or /usr/local (see in the makefile) or you can permanently add a config file in /etc/ld.conf.so.d/ with the path of your libs before calling 'sudo ldconfig'.

The best way is that you find where is this libproj.so; may be you just need a symlink to get postgres to find it.

  • Thanks a lot!!! It worked like a charm.
    – KrVa
    Commented Jun 21, 2019 at 8:35

I pass you a post, it is in Spanish, but it will be useful to install PostGIS 2.5 in Ubuntu 18.04 LTS post

  • Thanks!! Very useful post, it explains a lot about the configuration.
    – KrVa
    Commented Oct 6, 2018 at 0:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.