5

I just solved Repairing broken GDAL and PROJ.4 on Ubuntu? which was blocking use of ogrinfo and ogr2ogr, only to find that these utilities are garbled in one more way: whenever I run any of these, I get following error (this is for ogrinfo, for ogr2ogr it's analogical):

ERROR 1: ogrinfo was compiled against GDAL 1.9 but current library version is 1.10

I think I understand the cause: I mistakenly installed GDAL 1.9 manually through make-install as suggested here; make-uninstall is not possible for it. Ogrinfo was compiled to this version of GDAL and forgot about version 1.10 shipped with my QGIS (2.10). But I'm stuck here, with no idea how to re-compile ogr against the right version of GDAL.

What I tried:

  • reinstall QGIS (with sudo apt-get --purge autoremove to clean the dependencies after uninstall)
  • trash ogrinfo, ogr2ogr and even whole GDAL-1.9 directory; then I have recovered the ogr files but not gdal 1.9, though I can do it any time
  • few more options like sudo apt-get autoclean

Perhaps I could cleanly purge and install the ogr package if I knew it's exact name. Or do I need to purge the old version completely and then somehow (how?) tell the QGIS installer to install ogr as well?


I searched for all the gdal files on my computer and found that I have files for gdal-1.10 in /usr/bin/ and those for 1.9 in /usr/local/bin/. I manually deleted all the 1.9 files - @evilGenius pointed to this. Now there's just the last step: to point the system to the correct path to the binaries. As /usr/bin/ogrinfo it works perfectly.

  • All of the OGR tools are actually a part of the GDAL package, so if you (re)install the proper one you should get them. I believe that's what @AndreJ is getting at as well. It's possible that you manually installed GDAL to a different prefix than where QGIS puts it (ie. /usr vs. /usr/local). If that's the case, you may have to manually purge your compiled version. – Evil Genius Aug 7 '15 at 11:15
2

You can get GDAL 1.10 from http://download.osgeo.org/gdal/1.10.1/ and compile it the same way as you did with 1.9.

BTW, GDAL 1.11.2 is the current stable version, and installing QGIS on a vanilla lubuntu 15.04 includes that GDAL version. So if you remove (delete the self-compilation and sudo apt-get purge the packages) all GDAL and QGIS stuff, then reinstall QGIS 2.10, you should have it too.

Alternatively, http://packages.ubuntu.com/trusty/gdal-bin should give you the right GDAL package. I guess you removed the wrong (i.e. working) installation with sudo apt-get remove gdal-bin.

  • My problem is not how to find the right version, but how to make the system find it. I don't want to install anything new via make install; that would be just staying in a trap of apps almost impossible to uninstall. – Pavel V. Aug 7 '15 at 15:02
  • If you delete the self-compilation and add the official package, it should run without manual adjustment. – AndreJ Aug 7 '15 at 19:23

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.