Sunday 16 June 2019

Broken packages and unmet dependency installation QGIS, PostgreSQL and postgis Ubuntu 14.04


I am aware that this could be a duplicate topic but I am struggling for a several days. I upgraded QGIS from 2.8 to 2.18 and after that everything get broken. I couldn't use PostGIS extension on pgadmin3.



I figured out that there were a conflict with a libgdal1h: if installed, it removes other libraries used by PostGIS and vice versa.


I tried several tutorial about how to install QGIS, like for example:


How do I get and install the latest version of QGIS in Ubuntu?


Install QGIS 2.14 Essen on Ubuntu 16.04 Xenial


I tried every suggestion reported on line, like for example:


https://askubuntu.com/questions/351899/qgis-quantum-gis-install-fails-unmet-dependencies


https://askubuntu.com/questions/621406/dist-upgrade-in-ubuntu-14-04-uninstalled-qgis-and-results-in-unmet-dependencies


Where to find a version of libgeos-c1 compatible with libgeos-3.5.0?


QGIS install on Ubuntu 14.04 fails


Always, the reply of sudo apt-get install qgis python-qgis is:



The following packages have unmet dependencies:


python-qgis : Depends: python-qt4-sql but it is not installable
Depends: python-qgis-common (= 1:2.14.8+20trusty-ubuntugis) 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-pygments but it is not installable

Depends: python-yaml but it is not installable
Depends: python-pyspatialite but it is not installable
Depends: libqgispython2.14.8 but it is not going to be installed
Depends: libqgis-analysis2.14.8 but it is not going to be installed
Depends: libqgis-core2.14.8 but it is not going to be installed
Depends: libqgis-gui2.14.8 but it is not going to be installed
Depends: libqgis-networkanalysis2.14.8 but it is not going to be installed
Depends: libqgis-server2.14.8 but it is not going to be installed
Recommends: liblwgeom-dev but it is not installable
qgis : Depends: gdal-abi-2-1-0 but it is not installable

Depends: libgdal20 (>= 2.0.1) but it is not installable
Depends: libgeos-c1v5 (>= 3.4.2) but it is not installable
Depends: libqgis-analysis2.14.8 but it is not going to be installed
Depends: libqgis-app2.14.8 but it is not going to be installed
Depends: libqgis-core2.14.8 but it is not going to be installed
Depends: libqgis-gui2.14.8 but it is not going to be installed
Depends: libqgis-networkanalysis2.14.8 but it is not going to be installed
Depends: qgis-providers (= 1:2.14.8+20trusty-ubuntugis) but it is not going to be installed
Depends: qgis-common (= 1:2.14.8+20trusty-ubuntugis) but it is not going to be installed
Recommends: qgis-plugin-globe but it is not going to be installed

Recommends: qgis-plugin-grass but it is not going to be installed
Recommends: qgis-provider-grass but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I have removed all the packages and the libraries so I do not have any library related to postgis, postgres and QGIS with the Synaptic Package Manager and all with the commands:


sudo apt-get purge qgis
sudo apt-get autoremove qgis
sudo apt-get --purge remove qgis
sudo apt-get update


But the problem is not solved yet.


I tried to remove the repo of ubuntugis and/or debian on the file /etc/apt/sources.list.


Nothing.


And I do not understand why, using this source http://qgis.org/ubuntugis/ I still have issues about the dipendences.


What should I do?


I am planning to format my laptop hoping this will help me with broken packages.. for the broken packages, I have already tried:


sudo apt-get update –fix-missing
sudo apt-get install -f

but nothing fixed.




Answer



I encountered similar problems when updating from QGIS 2.16 to 2.18.


Try this workaround, that finally worked for me:


In the error message, look out for the lines


Depends: ... but it is not installable

Before installing qgis, you may need to install those packages manually one by one. If they install, try again to install QGIS, with some or all broken dependencies solved.


It might help to stick to the debian or ubuntugis repo, but avoid to install packages from both.


In my case, it was gdal that blocked the proper installation of QGIS.





UPDATE from comments


It seems that GDAL version conflicts avoid the proper installation.


According to http://postgis.net/install/ you have three choices for Postgis on Ubuntu:



This gives you postgis 2.2 compiled for Postgres 9.3. You can get QGIS 2.14.3 from the same repo, or use http://qgis.org/ubuntugis for QGIS 2.18.0 or 2.14.8. You will get GDAL 2.1.0 with that. This seems to be the best choice currently.



The one you used, but not compatible with QGIS from ubuntugis.



They offer Postgis 2.1.4, 2.2.2 and 2.3.0. You can get QGIS LTR from there too, or use http://qgis.org/debian for 2.18.0, compiled against GDAL 1.10 for trusty and GDAL 1.11.3 for xenial.




They offer Postgis 2.1.2 for Postgres 9,3, built with libgdal1h (GDAL 1.10.1) for trusty. The xenial package is Postgis 2.2.1 compiled against libgdal1i (GDAL 1.11.3). If you install QGIS from http://qgis.org/debian or http://qgis.org/debian-ltr, you get QGIS 2.18.0 or 2.14.8 compiled against the same GDAL versions for trusty and xenial.


You get broken dependencies if you try to combine packages from different sources, so DON'T DO IT.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...