2

I have downlaoded the OSGEO-Live 6.0 virtual machine running Linux Xubuntu. I have it running through VirtualBox on a Windows machine. It currently comes preinstalled with a lot of GIS software, including PostGIS 1.5. I would like to upgrade PostGIS to 2.x.

Having not used linux much, what is the best method to upgrade PostGIS from 1.5 to 2.x on the Xubuntu virtual machine? Since I just downloaded the Live-DVD, we can assume there is no data that needs to be retained.

RyanKDalton
  • 23,068
  • 17
  • 110
  • 178
  • useful link - http://gis.stackexchange.com/questions/28933/migrating-to-linux-from-windows – Mapperz Sep 06 '12 at 16:03
  • Would advise using ubuntu clean VirtualBox and use this guide for PostGIS - http://linfiniti.com/2012/05/installing-postgis-2-0-on-ubuntu/ have been using this for a good few months without issue. – Mapperz Sep 06 '12 at 16:05

1 Answers1

3

Following the instructions from Installing PostGIS 2.0 on ubuntu on linfiniti.com:

1)

  • sudo apt-add-repository ppa:sharpie/for-science # To get GEOS 3.3.2

  • sudo apt-add-repository ppa:sharpie/postgis-nightly

  • sudo apt-get update

  • sudo apt-get install postgresql-9.1-postgis

2) create a new database.

3) create postgis extension: CREATE EXTENSION postgis;

4) confirm the version: select postgis_full_version();

should be something like:

"POSTGIS="2.0.1 r9979" GEOS="3.3.3-CAPI-1.7.4" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.9.2, released 2012/10/08" LIBXML="2.7.8" RASTER"

RyanKDalton
  • 23,068
  • 17
  • 110
  • 178
leoze oze
  • 66
  • 3
  • So I did a select version() and it said the OSGEO Live DVD 6.0 is running postgresql 9.1.5. Running select postgis_full_version() says it is PostGIS 1.5.3. After creating a new DB, then CREATE EXTENSION postgis, I got ERROR: could not open extension control file "/usr/share/postgresql/9.1/extension/postgis.control": No such file or directory. Thoughts? – RyanKDalton Nov 03 '12 at 04:49
  • This post to the postgis user list suggests I would need to build PostGIS 2.0 from source... – RyanKDalton Nov 03 '12 at 04:54
  • Strange... I do the same. Do you have postgis-2.0 folder ? /usr/share/postgresql/9.1/contrib/postgis-2.0 – leoze oze Nov 03 '12 at 12:39
  • nope, just ../postgis-1.5. Did you install postgis-2.0 after you downloaded the VM? – RyanKDalton Nov 03 '12 at 14:12
  • 1
    I guess I did (and forgot!) using this: http://linfiniti.com/2012/05/installing-postgis-2-0-on-ubuntu – leoze oze Nov 05 '12 at 09:31
  • Thank you very much. Following the instructions on the linfiniti blog got me upgraded! – RyanKDalton Nov 06 '12 at 05:05