I am trying to build pgrouting on ubuntu. Therefore, I now firstly try to create a Postgis database on ubuntu.

I am following the instructions on this site:

Installing PostGIS 1.5 on PostgreSQL 8.4 on Ubuntu

I have installed postgresql and postgis.

I now try to run the necessary sql queries: psql -d my_db -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql

However, I got an error as shown in the screenshot below:


It looks like there is a problem with the query as -it firstly aborts the transactions continuously and -then says type "geometry", "box2d", "geometry" cannot be found

I was expecting these variables to occur as a result of this query. Why am I getting such an error while running the query?

Any idea would be more than welcome.


I checked the first error I get on this action:

ERROR Could not access the file "$libdir/postgis-1.5": No such file or directory

I have been checking on Google but not so useful yet. Any idea to fix it?

  • Your screenshot is not showing the first error. That is the one interesting. The rest is often just a result of the first error. May 7, 2012 at 11:21
  • Stop on the first error by adding -v ON_ERROR_STOP=1 to your psql command; more info
    – Mike T
    May 7, 2012 at 11:56
  • Hi Nicklas. As you said, I run it again and captured the first error. It now says: postgres@Bekir-Sony:/home/bekirtopaloglu$ psql -d my_routing -v ON_ERROR_STOP=1 -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql SET BEGIN psql:/usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql:59: ERROR: could not access file "$libdir/postgis-1.5": No such file or directory Any idea?
    – Bekir
    May 8, 2012 at 9:08

1 Answer 1


i think you have to check your GEOS - (Geometry Engine - Open Source) version. Box Types and Geometries mostly make the problem with old version of GEOS Library...

you can learn your GEOS version from PostGIS with this way :

postgres=# select PostGIS_full_version();
POSTGIS="2.0.0alpha4SVN" GEOS="3.3.2-CAPI-1.7.2" PROJ="Rel. 4.7.1,
7 September 2011" GDAL="GDAL 1.8.1, released 2011/07/09" LIBXML="2.7.3" USE_STATS
(1 row)

in addition to this you can check this answer...

i hope it helps you...

  • Thanks very much for your answer. I tried the command you suggested, it didn't work so I couldn't check my version. However, I have visited the GEOS web site and installed the latest version. [geos-3.3.3.tar.bz2] - However, I still get the same failure on geometry and box types while running sql queries on my database to make it postgis enabled. Any other idea?
    – Bekir
    May 7, 2012 at 12:23
  • you can also write this in sql editor area as SELECT PostGIS_full_version(), if geos not works, pls try to uninstall and update your ubuntu then install postgres which will compatible with your ubuntu version..
    – urcm
    May 7, 2012 at 13:21

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.