[GIS] raster2pgsql missing in Opengeo-suite installation

boundless-suitegeoserverpostgispostgresqlraster2pgsql

I installed opengeo-suite 3.0.2 on Ubuntu 12.04 and although the stack seems to be working fine, raster2pgsql is no where to be seen!

root@mywebsite:/usr/local/lib/postgresql/9.2# locate raster2pgsql
/usr/lib/postgresql/9.2/bin/raster2pgsql

root@mywebsite:/usr/lib/postgresql/9.2/bin/raster2pgsql# raster2pgsql
/usr/bin/raster2pgsql: No such file or directory

Did the installation go wrong? Or is it really not included in the opengeo-suite?


Update

ls -l /usr/bin/raster2pgsql
ls: cannot access /usr/bin/raster2pgsql: No such file or directory

ls -l /usr/lib/postgresql/9.2/bin/raster2pgsql
-rwxr-xr-x 1 root root 159016 Sep 24  2012 /usr/lib/postgresql/9.2/bin/raster2pgsql

Best Answer

It appears that your installation has simply located the executable you need in a directory that isn't in your current PATH. You could modify your PATH to check the directory (/usr/lib/postgresql/9.2/bin/), or you could create a symbolic link to the particular file, or you could just use the full path when you want to run the executable.

Taking each of these in turn: To modify your path, you can just edit the .bashrc file to include a line like:

export PATH=/usr/lib/postgresql/9.2/bin:$PATH

(usually somewhere towards the end) That will be the best option if there are other executables in that directory that you might want to use. This is probably what I would do.

Creating a symbolic link is easy (but requires superuser permissions to make it work for everyone):

sudo ln -s /usr/lib/postgresql/9.2/bin/raster2pgsql /usr/bin/raster2pgsql

Or just do

/usr/lib/postgresql/9.2/bin/raster2pgsql

(instead of just raster2pgsql) each time you'd like to use it.

There are other options (e.g. scripts, aliases, etc) but one of those should be enough to get you going.