Following the directions provided at this page and am getting the following errors.
The following packages have unmet dependencies:
python-qgis : Depends: python-qgis-common (= 1:2.8.8+20trusty) but it is not going to be installed
.......
E: Unable to correct problems, you have held broken packages.
Is this a problem with 16.04 or an error I have caused?
QGIS is available on Windows, macOS, Linux, Android and iOS.
QGIS has its version of python installed to handle all the required modules to run the software. So if you need to use the QGIS library from the python console/jupyter notebook, you need to make sure your python can find the QGIS library paths. Or you can install the QGIS library in your python environment.
The location is /usr/lib/qgis . In there you have the 'plugins' directory, if you need to add a plugin manually.
It's definitely not a problem with 16.04. I had faced a similar problem installing qgis after messing up some dependencies by install gnome3. I tried all those remove, autoremove, clean etc.. Tried removing and adding the ppa but none of it worked. I finally got it installed using aptitude package manager.
Try this first:
sudo apt-get update
then sudo apt-get -f install
.
If that doesn't work (didn't work for in this case too.) try the higher level package manager aptitude.
sudo aptitude install qgis python-qgis qgis-plugin-grass
It gives multiple solutions like below and you can select one. I would recommend answering no
for every question first time that way you get to see all the options. You can read what is going to be installed and removed to get the picture.
Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:
Downgrade the following packages:
1) libqt4-declarative [4:4.8.7+dfsg-7ubuntu1~xenialoverlay1~1 (now) -> 4:4.8.7+dfsg-5ubuntu2 (xenial)]
2) libqt4-network [4:4.8.7+dfsg-7ubuntu1~xenialoverlay1~1 (now) -> 4:4.8.7+dfsg-5ubuntu2 (xenial)]
3) libqt4-opengl [4:4.8.7+dfsg-7ubuntu1~xenialoverlay1~1 (now) -> 4:4.8.7+dfsg-5ubuntu2 (xenial)]
4) libqt4-script [4:4.8.7+dfsg-7ubuntu1~xenialoverlay1~1 (now) -> 4:4.8.7+dfsg-5ubuntu2 (xenial)]
5) libqt4-sql [4:4.8.7+dfsg-7ubuntu1~xenialoverlay1~1 (now) -> 4:4.8.7+dfsg-5ubuntu2 (xenial)]
6) libqt4-sql-sqlite [4:4.8.7+dfsg-7ubuntu1~xenialoverlay1~1 (now) -> 4:4.8.7+dfsg-5ubuntu2 (xenial)]
7) libqt4-svg [4:4.8.7+dfsg-7ubuntu1~xenialoverlay1~1 (now) -> 4:4.8.7+dfsg-5ubuntu2 (xenial)]
8) libqt4-xml [4:4.8.7+dfsg-7ubuntu1~xenialoverlay1~1 (now) -> 4:4.8.7+dfsg-5ubuntu2 (xenial)]
9) libqt4-xmlpatterns [4:4.8.7+dfsg-7ubuntu1~xenialoverlay1~1 (now) -> 4:4.8.7+dfsg-5ubuntu2 (xenial)]
10) libqtcore4 [4:4.8.7+dfsg-7ubuntu1~xenialoverlay1~1 (now) -> 4:4.8.7+dfsg-5ubuntu2 (xenial)]
11) libqtdbus4 [4:4.8.7+dfsg-7ubuntu1~xenialoverlay1~1 (now) -> 4:4.8.7+dfsg-5ubuntu2 (xenial)]
12) libqtgui4 [4:4.8.7+dfsg-7ubuntu1~xenialoverlay1~1 (now) -> 4:4.8.7+dfsg-5ubuntu2 (xenial)]
Accept this solution? [Y/n/q/?] y
The following packages will be DOWNGRADED:
libqt4-declarative libqt4-network libqt4-opengl libqt4-script libqt4-sql libqt4-sql-sqlite libqt4-svg libqt4-xml libqt4-xmlpatterns libqtcore4 libqtdbus4 libqtgui4
The following NEW packages will be installed:
libdrm-dev{a} libfcgi0ldbl{a} libgl1-mesa-dev{a} libglade2-0{a} libglu1-mesa-dev{a} libjs-jquery-ui{a} libjs-leaflet{a} liblwgeom-dev{a} libqca2{a} libqca2-plugin-ossl{a} libqca2-plugins{a}
libqgis-analysis2.18.3{a} libqgis-app2.18.3{a} libqgis-core2.18.3{a} libqgis-customwidgets{a} libqgis-gui2.18.3{a} libqgis-networkanalysis2.18.3{a} libqgis-server2.18.3{a} libqgisgrass7-2.18.3{a}
libqgispython2.18.3{a} libqjson0{a} libqt4-dbus{a} libqt4-designer{a} libqt4-dev{a} libqt4-dev-bin{a} libqt4-help{a} libqt4-opengl-dev{a} libqt4-qt3support{a} libqt4-scripttools{a} libqt4-test{a}
libqtassistantclient4{a} libqwt5-qt4{a} libspatialindex4v5{a} libx11-xcb-dev{a} libxcb-dri2-0-dev{a} libxcb-dri3-dev{a} libxcb-glx0-dev{a} libxcb-present-dev{a} libxcb-randr0-dev{a} libxcb-render0-dev{a}
libxcb-shape0-dev{a} libxcb-sync-dev{a} libxcb-xfixes0-dev{a} libxdamage-dev{a} libxext-dev{a} libxfixes-dev{a} libxshmfence-dev{a} libxxf86vm-dev{a} mesa-common-dev{a} python-cycler{a} python-dateutil{a}
python-future{a} python-gdal{a} python-glade2{a} python-httplib2{a} python-jinja2{a} python-markupsafe{a} python-matplotlib{a} python-matplotlib-data{a} python-pygments{a} python-pyparsing{a}
python-pyspatialite{a} python-qgis python-qgis-common{a} python-qscintilla2{a} python-qt4{a} python-qt4-sql{a} python-shapely{a} python-sip{a} python-tz{a} python-yaml{a} qdbus{a} qgis qgis-common{a}
qgis-plugin-grass qgis-plugin-grass-common{a} qgis-provider-grass{a} qgis-providers{a} qgis-providers-common{a} qt4-designer{a} qt4-linguist-tools{a} qt4-qmake{a} x11proto-damage-dev{a}
x11proto-dri2-dev{a} x11proto-fixes-dev{a} x11proto-gl-dev{a} x11proto-xext-dev{a} x11proto-xf86vidmode-dev{a}
The following packages are RECOMMENDED but will NOT be installed:
qt-at-spi
0 packages upgraded, 88 newly installed, 12 downgraded, 0 to remove and 57 not upgraded.
The most reliable way of installing FOSS4G on Debian or Ubuntu is using the Debian/Ubuntu GIS repository network. Personally I use the ubuntu-gis unstable PPA, where packages are actually quite stable.
You can add this PPA to your sources by editing the sources.list
file:
sudo pico /etc/apt/sources.list
And adding the following lines:
deb http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu xenial main
deb-src http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu xenial main
Finally update your sources and install QGis:
sudo apt update
sudo apt install qgis
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With