[postgis-users] Problems installing on Linux
Wilkins, Brian
bwilkins at harris.com
Tue Aug 6 11:07:45 PDT 2013
Also, I had to modify the postgis.sql to point to the proper location of my postgis install, so I executed:
$ sed -i "s/\$libdir/\/opt\/postgis\/lib64\/pgsql/g" postgis.sql
It didn't know what $libdir was so I had to tell it.
From: Wilkins, Brian
Sent: Tuesday, August 06, 2013 2:05 PM
To: 'PostGIS Users Discussion'
Subject: RE: [postgis-users] Problems installing on Linux
Essentially, yes. See here: http://postgis.net/docs/postgis_installation.html#hard_upgrade
I am not completely clear on your upgrade path, but this is how I did a recent upgrade:
1. Untarred postgis
2. Ran configure with --with-geoconfig and --with-projdir set
3. Moved the old postgis install to new name
4. Make postgis
5. Make install DESTDIR=/opt/postgis
6. Changed ownership of my postgis build directory and share/pgsql directory to postgres:users
7. Modified the postgis-version/utils/postgis_restore.pl to remove the portion where the database is created
8. Backed up my existing database
a. pg_dumpall -h localhost -p 5432 -U <username> -globals-only > globals.sql
b. pg_dump -d -Fc <database name> > /tmp/<dumpname>.dmp
c. pg_dump <database name> -t <special table you want to dump - this is optional> > /tmp/<table>.sql (optional - used for testing upon restore)
9. Login as postgres user
10. $ psql
11. postgres=# drop database <database name>;
12. DROP DATABASE
13. postgres=# \q
14. $ psql -U postgres -d postgres -f globals.sql (may not be needed but I did it anyways because I upgraded the DB too)
15. $ createdb -U <username>
16. $ createdb -U <username> database
17. $ createlang -U postgres plpgsql -d database
18. $ psql -U postgres -f postgis.sql -d database
19. $ psql -U postgres -f spatial_ref_sys.sql -d database
20. $ sh share/pgsql/contrib/utils/postgis_restore.pl <upgrade sql script under contrib> <database name> <dump file name> &> restore.log
21. Finally after examing for any errors:
22. psql -c 'select postgis_full_version();' -d <database name>
23. And finally, run some tests. For instance, I had a non-postgis table that I dumped again and diff'd with my original dump. Or you can execute an ST_Extent on a geolocation.. up to you
From: postgis-users-bounces at lists.osgeo.org<mailto:postgis-users-bounces at lists.osgeo.org> [mailto:postgis-users-bounces at lists.osgeo.org] On Behalf Of James David Smith
Sent: Tuesday, August 06, 2013 1:44 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Problems installing on Linux
Sorry Brian, but I'm not sure what that means. There are a few scripts in the postgis 2 contrib directory. Do I just run them like I've been running the above commands e.g. psql -d yourdatabase -f postgis.sql
On 6 Aug 2013 18:08, "Wilkins, Brian" <bwilkins at harris.com<mailto:bwilkins at harris.com>> wrote:
I am coming in a little late, but when I did an upgrade, I had to run my dump through one of the postgis update scripts in the contrib directory. Did you do that?
Brian
-----Original Message-----
From: postgis-users-bounces at lists.osgeo.org<mailto:postgis-users-bounces at lists.osgeo.org> [mailto:postgis-users-bounces at lists.osgeo.org<mailto:postgis-users-bounces at lists.osgeo.org>] On Behalf Of James David Smith
Sent: Tuesday, August 06, 2013 12:54 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Problems installing on Linux
On 6 August 2013 15:38, Rémi Cura <remi.cura at gmail.com<mailto:remi.cura at gmail.com>> wrote:
> Hello,
> I had trouble with geos.
> Strangely, I had to turn postgres down, then make clean in geos, then
> build and install, then clean postgis, then build and install, then
> restart postgres.
> I had error if not stopping my (local) server, and if not cleaning
> geos and postgis before building
>
> Cheers,
>
> Rémi-C
>
>
> 2013/8/6 Mike Toews <mwtoews at gmail.com<mailto:mwtoews at gmail.com>>
>>
>> On 6 August 2013 22:49, James David Smith
>> <james.david.smith at gmail.com<mailto:james.david.smith at gmail.com>>
>> wrote:
>> >
>> > Hi Mike,
>> >
>> > Thanks for the reply. I thought that I had the latest version of
>> > GEOS, so I just did 'locate geos' and it found quite a few files.
>> > They seem to be grouped into the below folders:
>> >
>> > /depot/shared/geos-3.0.3/
>> > /depot/shared/geos-3.3.5/
>> > /opt/geos-3.3.8/include/geos/
>> > /depot/shared/pgrouting/geos-3.0.0/
>> > /depot/shared/pgrouting/geos-3.3.5/
>> > /opt/Geos/
>> >
>> > I guess that this is causing the problem.
>> >
>> > Though when I do the "./configure" command for PostGIS I have been
>> > pointing the it towards:
>> >
>> > /opt/geos-3.3.8/bin/geos-config
>> >
>> > Which should make it use the latest version of GEOS no?
>> >
>> > Sorry for not being very technical, I'm slowly getting the hang of
>> > linux...
>> >
>> > Thanks
>> >
>> > James
>>
>> Technical is always good here. Sometimes it is necessary to update
>> the shared library cache by running "ldconfig" after various "make
>> install" commands. It might need to be run as root (or with sudo, if
>> you have that).
>>
>> Also, sometimes, it could be also necessary to either add the LIBDIR
>> to /etc/ld.so.conf, or add a .conf file in /etc/ld.so.conf.d/, or to
>> fiddle around with the LD_LIBRARY_PATH environment variable to point
>> to the directory with the current versions of .so shared libraries
>> After any changes with these, run "ldconfig" to update the system
>> cache. Yet another good tool is "ldd" to see which libraries are
>> being loaded. For example:
>>
>> $ ldd /usr/pgsql-9.0/lib/postgis-2.0.so<http://postgis-2.0.so>
>>
>> should show you which other .so objects are being referenced.
>>
>> -Mike
>> _______________________________________________
Hi Mike/Remy/all,
Thanks for your help. I'm making progress. Please see below. My install is now using geos-3.3.8. Or seems to be.
ldd /usr/pgsql-9.0/lib/postgis-2.0.so<http://postgis-2.0.so>
linux-vdso.so.1 => (0x00007fff735fc000)
libgeos_c.so.1 => /opt/Geos/lib/libgeos_c.so.1 (0x00002b4411d4d000)
libproj.so.0 => /opt/Proj/lib/libproj.so.0 (0x00002b4411f74000)
libjson.so.0 => /opt/json/lib/libjson.so.0 (0x00002b44121ca000)
libxml2.so.2 => /opt/LibXml/lib/libxml2.so.2 (0x00002b44123cb000)
libz.so.1 => /usr/lib64/libz.so.1 (0x00002b441270e000)
libm.so.6 => /lib64/libm.so.6 (0x00002b4412922000)
libc.so.6 => /lib64/libc.so.6 (0x00002b4412ba5000)
libgeos-3.3.8.so<http://libgeos-3.3.8.so> => /opt/Geos/lib/libgeos-3.3.8.so<http://libgeos-3.3.8.so>
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00002b44132ab000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002b44135ab000)
libjson-c.so.2 => /opt/json/lib/libjson-c.so.2 (0x00002b44137ba000)
libdl.so.2 => /lib64/libdl.so.2 (0x00002b44139c3000)
/lib64/ld-linux-x86-64.so.2 (0x0000003f53000000)
The following commands now seem to work:
psql -d yourdatabase -f postgis.sql
psql -d yourdatabase -f postgis_comments.sql psql -d yourdatabase -f spatial_ref_sys.sql
And when I go into my database and do SELECT postgis_full_version I get the following:
POSTGIS="2.0.4SVN r11660" GEOS="3.3.8-CAPI-1.7.8" PROJ="Rel. 4.6.1, 21 August 2008" LIBXML="2.7.6" LIBJSON="UNKNOWN" TOPOLOGY
However it says that Topology and Raster support are not present. So I thought that I could now run the following commands to install those
too:
psql -d yourdatabase -f rtpostgis.sql
psql -d yourdatabase -f raster_comments.sql psql -d yourdatabase -f topology/topology.sql psql -d yourdatabase -f doc/topology_comments.sql
However when I run them I get an error. The first line is:
psql:/usr/pgsql-9.0/share/contrib/postgis-2.0/rtpostgis.sql:48: ERROR:
could not load library "/usr/pgsql-9.0/lib/rtpostgis-2.0.so<http://rtpostgis-2.0.so>":
libgeos-3.2.0.so<http://libgeos-3.2.0.so>: cannot open shared object file: No such file or directory
Any idea why there is still mention of libgeos-3.2.0 ? I thought I'd sorted that out now?
Thanks
James
_______________________________________________
postgis-users mailing list
postgis-users at lists.osgeo.org<mailto:postgis-users at lists.osgeo.org>
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
postgis-users at lists.osgeo.org<mailto:postgis-users at lists.osgeo.org>
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130806/ae1934bf/attachment.html>
More information about the postgis-users
mailing list