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

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?


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
  • Looks like its there from the snippet you've posted. Why do you think its "no where to be seen"?
    – BradHards
    Apr 22 '13 at 9:47
  • @BradHards Sorry I forgot to include the next line. Updated my question. Typing raster2pgsql gave an error. I see raster2pgsql in the ls -l of /usr/lib/postgresql/9.2/bin/raster2pgsql
    – Nyxynyx
    Apr 22 '13 at 13:24
  • Can you paste the results of ls -l /usr/bin/raster2pgsql? Similarly, can you paste the results of ls -l /usr/lib/postgresql/9.2/bin/raster2pgsql? It looks like you possibly had an old install, or your PATH environment variable isn't set up correctly, but I just need a bit more information before trying to write an authoritative answer.
    – BradHards
    Apr 22 '13 at 22:54
  • @BradHards Updated question with the results of both commands.
    – Nyxynyx
    Apr 23 '13 at 3:13

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


(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.

  • I tried on the command line /usr/lib/postgresql/9.2/bin/raster2pgsql and it gave the error -bash: usr/lib/postgresql/9.2/bin/raster2pgsql: No such file or directory. What do you think?
    – Nyxynyx
    Apr 23 '13 at 20:21
  • Did you leave off the first / character?
    – BradHards
    Apr 23 '13 at 21:49
  • 1
    Thanks it works now! I linked it using ln -s /usr/lib/postgresql/9.2/bin/raster2pgsql /usr/bin/raster2pgsql
    – Nyxynyx
    Apr 23 '13 at 22:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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