PostGIS psqlostgis ERROR could not load library /usr/lib/postgresql/8.4/lib/

Trying to install PostGIS and you can’t get past this error?

psqlostgis.sql:57: NOTICE:  type “spheroid” is not yet defined
DETAIL:  Creating a shell type definition.
psqlostgis.sql:57: ERROR:  could not load library “/usr/lib/postgresql/8.4/lib/”: /usr/lib/postgresql/8.4/lib/ undefined symbol: GEOSHausdorffDistance
psqlostgis.sql:63: ERROR:  current transaction is aborted, commands ignored until end of transaction block
psqlostgis.sql:68: ERROR:  current transaction is aborted, commands ignored until end of transaction block

A simple solution to your problem is the following voodoo command

sudo /sbin/ldconfig

Check out it’s voodoo magic at ldconfig

As far as my feeble mind can determine, it links some files or something..  What I know is that it has saved my colleagues ass once before and mine when I was setting up a Red Hat install for ruby on rails.

Enjoy your Postgresql PostGIS geographic goodness!

Posted on March 10, 2010 at 12:44 pm by Jordan Carter · Permalink
In: Ruby on Rails, Server Config · Tagged with: , , , ,

5 Responses

  1. Written by Julián Perelli
    on March 10, 2010 at 5:40 pm

    I cant believe it! you saved me a lot of time! :)
    Thank you!!

  2. Written by Anon e. Mouse
    on May 19, 2010 at 7:37 am

    I was getting the same error. “ldconfig” did not help, but I used “ldd” and found some old LibXML libraries. I then searched for old GEOS library files and found some in the PostgreSQL utils library.

    I removed the libgeos files from the PostgreSQL utils library, and the PostGIS installation worked.

  3. Written by Tom Brody
    on June 28, 2010 at 11:03 pm

    Ouch, it took me about 15 minutes to find your post, plus another hour since I first tried fixing this myself. Didn’t expect a THAT easy solution, but thanks alot!

  4. Written by Brendan Richards
    on August 31, 2010 at 7:19 pm

    thanks to these comments, I worked out where to start looking to fix my issue.

    I had postgres installed via EnterpriseDB which bundled an old version of postgis.
    I installed the following libraries from source:

    but postgis failed to install with a similar error: undefined symbol: GEOSHausdorffDistance

    after moving old lib files and replacing with new copies from /usr/local/lib it worked for me:

    1) backup lib files:
    cd /opt/PostgresPlus/8.4SS/lib
    mkdir backup
    mv libgeos* backup
    mv libproj* backup

    2) copy in newer lib files
    cp /usr/local/lib/libgeos* ./
    cp /usr/local/lib/libproj* ./

    after thses steps, running the postgis.sql script worked.

  5. Written by Artyom
    on November 29, 2011 at 8:37 pm

    apt-get install geos =)))

Leave a Reply