7

After sudo apt-get install postgresql-9.1-postgis I got that massage:

The following packages have unmet dependencies: postgresql-9.1-postgis : Depends: libgdal1 (>= 1.9.0) but it is not going to be installed E: Unable to correct problems, you have held broken packages.

I tryed the ubuntugis-unstable and ubuntugis-stable repositories. I have QGIS 2.2 installed.

1

3 Answers 3

8

This annoying issue occurs because libgdal was forked between libgdal1 and libgdal1h last year. Ubuntu GIS stable uses libgdal or libgdal1, Ubuntugis unstable uses libgdal1h.

GDAL is a translator library for raster geospatial data formats. As a library, it presents a single abstract data model to the calling application for all supported formats. The related OGR library (which lives within the GDAL source tree) provides a similar capability for simple features vector data.

You will have to start from fresh.

Make sure you uninstall all software remnants of Ubuntugis Stable / Unstable. Uninstalling libgdal, libgdal1, libgdal1h will remove all software that depends on it. Then check your repos, make sure Ubuntugis Stable & Unstable isn't there.

Then add these repos for QGIS 2.2, Saga 2.1 and Postgres 9.3.3 & PostGIS 2.1.1.

http://www.qgis.org/en/site/forusers/alldownloads.html#ubuntu

Johan Van de Wauw's saga-gis repository

https://wiki.postgresql.org/wiki/Apt

I usually install QGIS first then SAGA, Grass, PostgreSQL 9.3.3, PostGIS 2.1.1, postgresql-contrib-9.3 and finally pgAdmin3.

There are a few small issues. This will install Grass 6.4.3-2, which might not work from Processing in QGIS 2.2. Grass 6.4.3-3, provided by Ubuntugis Unstable, is supposed to fix the problem (but did not work for me on Ubuntu 13.10).

Also, only Ubuntu GIS Unstable provides pgRouting as far as I know (with PostgreSQL 9.1 & PostGIS 2.1.0). If you want pgRouting you will have to compile it from source, it only takes few minutes. If Configure complain that Postgresql-9.1 is not installed, install postgresql-server-dev-9.1 and try again.

5
  • How can I also install the latest version of GDAL?
    – JJD
    May 5, 2014 at 19:17
  • 1
    This post confuses the heck out of me. Can you give me code samples I can work with? Nothing I did worked.
    – picardo
    Jun 19, 2014 at 23:02
  • 1
    ps: I'm not using Ubuntu GIS. Just plain Ubuntu.
    – picardo
    Jun 19, 2014 at 23:06
  • @picardo running into this now too... let's keep in touch as I'd like to repair the now broken installation instructions I wrote here: trac.osgeo.org/postgis/wiki/UsersWikiPostGIS21UbuntuPGSQL93Apt Jun 20, 2014 at 16:05
  • For me, the installation works when I ssh into the server, but it fails when I use a build script, like a Dockerfile. There is no rhyme or reason for it.
    – picardo
    Jun 20, 2014 at 17:06
2

This worked for me.

Change the line in the Dockerfile that has the install to use 2.0 postgis:

RUN apt-get -y -q install postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3 postgresql-9.3-postgis-2.0
0

I've sucessfully (without any broken dependencies) installed postgresql-9.1-postgis-2.0 instead of postgresql-9.1-postgis.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.