1

I am trying to install QGIS (any version) on Ubuntu 16.04 and Python 2.7 or Python 3.7.2

I run the sudo apt-get install qgis python-qgis qgis-plugin-grass saga and I get :

Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python-qgis : Depends: python-qgis-common (= 1:2.18.16+20trusty) but it is not going to be installed
               Depends: libqgispython2.18.16 but it is not going to be installed
               Depends: libqgis-analysis2.18.16 but it is not going to be installed
               Depends: libqgis-core2.18.16 but it is not going to be installed
               Depends: libqgis-gui2.18.16 but it is not going to be installed
               Depends: libqgis-networkanalysis2.18.16 but it is not going to be installed
               Depends: libqgis-server2.18.16 but it is not going to be installed
               Recommends: liblwgeom-dev but it is not going to be installed
 qgis : Depends: libgdal1h (>= 1.8.0) but it is not installable
        Depends: libgeos-c1 (>= 3.4.2) but it is not installable
        Depends: libgsl0ldbl (>= 1.9) but it is not installable
        Depends: libqgis-analysis2.18.16 but it is not going to be installed
        Depends: libqgis-app2.18.16 but it is not going to be installed
        Depends: libqgis-core2.18.16 but it is not going to be installed
        Depends: libqgis-gui2.18.16 but it is not going to be installed
        Depends: libqgis-networkanalysis2.18.16 but it is not going to be installed
        Depends: qgis-providers (= 1:2.18.16+20trusty) 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.16+20trusty) but it is not going to be installed
                     Depends: libgdal1h (>= 1.8.0) but it is not installable
                     Depends: libqgis-app2.18.16 but it is not going to be installed
                     Depends: libqgis-core2.18.16 but it is not going to be installed
                     Depends: libqgis-gui2.18.16 but it is not going to be installed
                     Depends: libqgisgrass6-2.18.16 but it is not going to be installed
                     Depends: grass-core but it is not going to be installed
                     Depends: grass643 but it is not installable
 saga : Depends: saga-common (= 2.3.1+dfsg-3~ubuntugis~xenial2) but 2.3.1+dfsg-3~ubuntugis~xenial6 is to be installed
        Depends: gdal-abi-2-1-3
E: Unable to correct problems, you have held broken packages.

How do I fix this?

  • It seems to be a problem with ubuntugis repositories, this was asked two days ago. – Gabriel De Luca Jan 27 at 15:34
  • @GabrielDeLuca for xenial, the ubuntugis way should work (and has to for QGIS 3). – AndreJ Jan 28 at 7:33
1

The dependencies show an ubuntu version mismatch:

Depends: python-qgis-common (= 1:2.18.16+20trusty)
Depends: qgis-providers (= 1:2.18.16+20trusty)
Depends: qgis-provider-grass (= 1:2.18.16+20trusty)
Depends: saga-common (= 2.3.1+dfsg-3~ubuntugis~xenial2)

Since you are on Ubuntu 16.04, you should request qgis xenial packages, not those for trusty.

Regarding saga, the current version should be 2.3.1+dfsg-3~ubuntugis~xenial6, compiled against gdal 2.2.2+dfsg-1~xenial1 . Maybe you did not upgrade and update your sources before installing.

Check apt-cache policy saga to check what versions you can get. The same works for gdal and qgis.

  • Thank you, although my problem persists you taught me about the apt-get cache thing. where would i find out about using xenial vs trusty ? how do you know xenial is for ubuntu pls? – Mickey Perlstein Jan 30 at 8:59
  • 1
    xenial is ubuntu 16.04, and trusty is ubuntu 14.04, see releases.ubuntu.com – AndreJ Jan 30 at 12:50
  • still could not make it work - sigh – Mickey Perlstein Feb 11 at 13:44
  • 2
    The grass part of qgis-ubuntugis is currently broken until the next point release, but the rest should be installable. – AndreJ Feb 11 at 18:56
  • i was unable to install the rest, grass breaks everything. and for some unknown reason it refers to my python2.7 installation even though i source it to my python 3.5.2 env – Mickey Perlstein Feb 18 at 15:58

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.