[GIS] How to install shp2pgsql and raster2pgsql from source

command linecompilepostgis

I just installed PostGIS 2.4.0alpha from source by following osgeo instructions on Ubuntu 16.04.

After installation, PostGIS seems to work. However, command line tools that are supposed to come with PostGIS are not installed.

For example, shp2pgsql is missing after sudo make install.

$ shp2pgsql
The program 'shp2pgsql' is currently not installed. You can install it by typing:
sudo apt install postgis

(similarly raster2pgsql is also missing).

Looking into the postgis-2.4.0alpha/loader folder, the executables shp2pgsql and pgsql2shp are present.

What steps do I need to do beyond sudo make install to install the command line tools such as shp2pgsql and raster2pgsql?

Best Answer

It turns out that this is a PATH issue as pointed out in @JohnPowellakaBarça comment. And I solved the problem by adding /usr/lib/postgresql/9.6/bin to system path.

Somehow make install in PostGIS 2.4.0alpha installed the binaries to the above folder but didn't install the symlinks to /usr/bin.