2

I have Ubuntu 16.04 with postgresql 9.6 postgis 2.3 QGIS 2.18 installed.

I am trying to install mapview (R library) with no success because of sf defencency.

I had this output:

    configure: GDAL: 1.11.3
checking GDAL version >= 2.0.0... no
configure: error: sf is not compatible with GDAL versions below 2.0.0
ERROR: configuration failed for package ‘sf’
* removing ‘/usr/local/lib/R/site-library/sf’ 

and this is what happened on the terminal:

$gdalinfo --version
GDAL 2.1.0, released 2016/04/25
$ gdal-config --version
1.11.3

I am wondering the following questions:

Which is the difference between gdalinfo and gdal-config ?

Why does R say me that I have a GDAL version less than 2.0.0 even if output of gdalinfo --version is GDAL 2.1.0?

How can I upgrade Gdal-config to one >= 2.0.0?

If I upgrade, will I have problem with postgresql, postgis Qgis or some other python module that use GDAL?

2

gdal-config is part of the package libgdal-dev, while gdalinfo is part of gdal-bin.

You can run apt-cache policy <packagename> to see what you have installed, and what is available for you.

Surely both packages should be from the same GDAL release to get things running without errors.

GDAL version 1.11.3 is in the main ubuntu repo, ubuntugis unstable PPA has 2.1.3, while ubuntugis (stable) has 2.1.0 for Xenial.

  • Great! Thank you! Really useful! @AndreJ, this is the output of apt-cache policy libgdal-dev libgdal-dev: Installed: 1.11.3+dfsg-3build2 Candidate: 1.11.3+dfsg-3build2 Version table: *** 1.11.3+dfsg-3build2 500 500 http://es.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages 100 /var/lib/dpkg/status It seems I cannot upload to version 2.1.0 without any conflict..right? – Glori P. Jul 6 '17 at 10:02
  • Please run the same on gdal-bin to see where you got that in version 2.1.0 from. – AndreJ Jul 6 '17 at 11:20
  • Hi @AndreJ this is the output: gdal-bin: Installed: 2.1.0+dfsg-1~trusty2 Candidate: 2.1.0+dfsg-1~trusty2 Version table: *** 2.1.0+dfsg-1~trusty2 100 100 /var/lib/dpkg/status 1.11.3+dfsg-3build2 500 500 http://es.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages – Glori P. Jul 6 '17 at 11:22
  • Seems you have removed a ubuntugis ppa after installing. If R needs that, you have to add the ppa back to your sources and update. Where did you get postgis from? Ubuntugis unstable has postgresql-9.5-postgis-2.3. – AndreJ Jul 6 '17 at 11:24
  • 1
    I did not remember ;-)- But now you are stucked with R expecting GDAL 2. Perhaps you should set up a virtual box to see if you can upgrade to GDAL 2 and dependent packages for postgis and R with ubuntugis unstable. If you fail, you still have your current database running safely. – AndreJ Jul 6 '17 at 11:37

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.