[GIS] How to reinstall QGIS from scratch on Ubuntu

errorinstallationqgisrepositoryUbuntu

System info: Ubuntu 16.04.3 LTS, kernel 4.10.0-33-generic


I was trying to update QGIS using these steps. For some reason, it broke in the process and I'm not able to start it anymore. Executing qgis gives me the following:

/usr/bin/qgis.bin: symbol lookup error: /usr/lib/libqgis_core.so.2.14.17: undefined symbol: OGR_F_SetFieldNull

I didn't really know what to make of it, so I tried reinstalling the whole thing. Specifically running

sudo apt purge qgis* python-qgis* --auto-remove
sudo apt install qgis python-qgis qgis-plugin-grass

However, at the end of the installation process I now get the messages:

dpkg: dependency problems prevent configuration of qgis:
 qgis depends on qgis-providers (= 2.14.17+dfsg-1~xenial3); however:
  Package qgis-providers is not configured yet.

dpkg: error processing package qgis (--configure):
 dependency problems - leaving unconfigured
Setting up qgis-plugin-grass-common (2.14.17+dfsg-1~xenial3) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          dpkg: dependency problems prevent configuration of qgis-provider-grass:
 qgis-provider-grass depends on qgis (= 2.14.17+dfsg-1~xenial3); however:
  Package qgis is not configured yet.

dpkg: error processing package qgis-provider-grass (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of qgis-plugin-grass:
 qgis-plugin-grass depends on qgis (= 2.14.17+dfsg-1~xenial3); however:
  Package qgis is not configured yet.
 qgis-plugin-grass depends on qgis-provider-grass (= 2.14.17+dfsg-1~xenial3); however:
  Package qgis-provider-grass is not configured yet.

No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          No apport report written because MaxReports is reached already
                                                                                                                                                                        dpkg: error processing package qgis-plugin-grass (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Errors were encountered while processing:
 qgis-providers
 qgis
 qgis-provider-grass
 qgis-plugin-grass
E: Sub-process /usr/bin/dpkg returned an error code (1)

I then tried the same thing without the QGIS repositories, but with the same results, which is why I'm thinking there are still some broken leftovers from my previous attempts on my machine.

Is there any way to nuke my QGIS installation more thoroughly than by using sudo apt purge qgis* python-qgis* --auto-remove, so that absolutely nothing is left?

Best Answer

sudo software-properties-gtk

there in the package manager remove qgis and ubuntugis from the list;

sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get -f install
sudo apt-get autoremove qgis
sudo apt-get --purge remove qgis

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install qgis python-qgis qgis-plugin-grass

this worked once for me, in my trusty that installs qgis essen

Related Question