[GIS] QGIS installation fails under Ubuntu 16.04

debiangdalpostgisqgisubuntugis

I decided yesterday to upgrate QGIS from 2.16 to 2.18. This turned out to be a stupid idea, because the following happened:

After removing, purging and autoremoving qgis, python-gis and grass
I tried to install the new version using the http://qgis.org/debian repositories.

The result was:

The following packages have unmet dependencies.
python-qgis : Depends: python-qt4-sql but it is not installable
               Depends: python-qgis-common (= 1:2.18.1+24xenial) but it is not going to be installed
               Depends: python-psycopg2 but it is not installable
               Depends: python-qscintilla2 but it is not installable
               Depends: python-jinja2 but it is not installable
               Depends: python-markupsafe but it is not installable
               Depends: python-dateutil but it is not installable
               Depends: python-requests but it is not installable
               Depends: python-tz but it is not installable
               Depends: python-yaml but it is not installable
               Depends: python-future but it is not installable
               Depends: python-pyspatialite but it is not installable
               Depends: libqgispython2.18.1 but it is not going to be installed
               Depends: libqgis-analysis2.18.1 but it is not going to be installed
               Depends: libqgis-core2.18.1 but it is not going to be installed
               Depends: libqgis-gui2.18.1 but it is not going to be installed
               Depends: libqgis-networkanalysis2.18.1 but it is not going to be installed
               Depends: libqgis-server2.18.1 but it is not going to be installed
               Depends: libqscintilla2-12v5 (>= 2.8.4) but it is not installable
               Recommends: liblwgeom-dev but it is not installable
 qgis : Depends: libgdal.so.1-1.11.3 but it is not installable
        Depends: libgdal1i (>= 1.8.0) but it is not installable
        Depends: libgeos-c1v5 (>= 3.4.2) but it is not installable
        Depends: libqgis-analysis2.18.1 but it is not going to be installed
        Depends: libqgis-app2.18.1 but it is not going to be installed
        Depends: libqgis-core2.18.1 but it is not going to be installed
        Depends: libqgis-gui2.18.1 but it is not going to be installed
        Depends: libqgis-networkanalysis2.18.1 but it is not going to be installed
        Depends: qgis-providers (= 1:2.18.1+24xenial) but it is not going to be installed
        Depends: qgis-common (= 1:2.18.1+24xenial) but it is not going to be installed
        Recommends: qgis-provider-grass but it is not going to be installed
 qgis-plugin-grass : Depends: qgis-provider-grass (= 1:2.18.1+24xenial) but it is not going to be installed
                     Depends: libgdal1i (>= 1.8.0) but it is not installable
                     Depends: libqgis-app2.18.1 but it is not going to be installed
                     Depends: libqgis-core2.18.1 but it is not going to be installed
                     Depends: libqgis-gui2.18.1 but it is not going to be installed
                     Depends: libqgisgrass7-2.18.1 but it is not going to be installed
                     Depends: grass-core but it is not installable
E: Unable to correct problems, you have held broken packages.

I checked online for help and found
Broken packages and unmet dependency installation QGIS, PostgreSQL and postgis Ubuntu 14.04
and QGIS install on Ubuntu 14.04 fails

The problem described there is very similar to mine only that I am working on ubuntu 16.04 and the missed packages are slightly different.
Unfortunately the proposed solutions doesn't work for my case:

  • Installing the named packages individually only leads to more uninstalable packages.

  • Using the ubuntugis repository results in the error message:

    The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 089EBE08314DF160

    and ignoring this again lead to no installable files.

  • Using sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 073D307A618E5811

    only leads to:

    gpg: requesting key 618E5811 from hkp server keyserver.ubuntu.com
    gpg: keyserver timed out
    gpg: keyserver receive failed: keyserver error

  • apt list --installed | grep gdal dosn't find anything

  • And installing PostGIS manually also ends up in unistalable packages.

Can somebody please tell if there is anything else I can do?

I have been struggling here for more than a day.

I assume that something is messed up with the sources but I don't know how to find out what or how to repair it.

EDIT after comments

I now managed to get around the key-server errow and access the ubntugis ppa without problems.
(The solution for this was to properly install the ppa using sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable )

Trying to install qgis using the sources
deb http://qgis.org/ubuntugis xenial main
deb-src http://qgis.org/ubuntugis xenial main
deb http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu xenial main

again results in a number of unmet dependencies. One of them is libgdal20. Trying to install this (as recommended by ArneJ) leads to the the following unmet dependencies

libgdal20 : Depends: libarmadillo6 but it is not installable
             Depends: libcrypto++9v5 but it is not installable
             Depends: libdap17v5 but it is not installable
             Depends: libdapclient6v5 but it is not installable
             Depends: libepsilon1 (>= 0.8.1) but it is not installable
             Depends: libfreexl1 (>= 0.0.2~beta20110817) but it is not installable
             Depends: libgeos-c1v5 (>= 3.4.2) but it is not installable
             Depends: libgeotiff2 (>= 1.4.1) but it is not installable
             Depends: libhdf4-0-alt but it is not installable
             Depends: libhdf5-10 but it is not installable
             Depends: libkmlbase1 (>= 1.3.0~r864) but it is not installable
             Depends: libkmldom1 (>= 1.3.0~rc2) but it is not installable
             Depends: libkmlengine1 (>= 1.3.0~r864) but it is not installable
             Depends: libmysqlclient20 (>= 5.7.11) but it is not installable
             Depends: libnetcdf11 (>= 4.0.1) but it is not installable
             Depends: libogdi3.2 but it is not installable
             Depends: libopenjp2-7 (>= 2.0.0) but it is not installable
             Depends: libpq5 but it is not installable
             Depends: libproj9 (>= 4.8.0) but it is not installable
             Depends: libqhull7 but it is not installable
             Depends: libspatialite7 (>= 4.2.0) but it is not installable
             Depends: libxerces-c3.1 but it is not installable
             Recommends: proj-bin but it is not installable

Best Answer

Problem solved!!! The problem were in fact the missing software sources and How do I resolve unmet dependencies after adding a PPA? finally helped.

(I don't understand how I was able to install qgis16 earlier, but some mysteries have to remain unsolved...)

Related Question