6

In the fall of 2018, I successfully installed QGIS 3.x on my old Xubuntu 18.04 laptop (it keeps updating, and now it is 3.6). A couple of months ago I had to move to another laptop (again under Xubuntu 18.04) but this time, no matter which depository I add, installation ends up with roughly the same errors:

python-qgis : Depends: libqgis-analysis3.6.0 but it is not going to be installed
qgis : Depends: gdal-abi-2-2-3
    Depends: python3-qgis (= 1:3.6.1+28bionic) but it is not going to be installed
qgis-plugin-grass : Depends: grass740

Attempts to install these packages ended up quick with unmet dependencies. The repositories I tried for sure are:

deb https://qgis.org/debian bionic main

deb https://qgis.org/ubuntugis bionic main

deb https://qgis.org/ubuntu-ltr/ bionic main
deb-src https://qgis.org/ubuntu-ltr/ bionic main

The advices I followed (unsuccessfully): (1) https://www.gis-blog.com/how-to-install-qgis-3-on-ubuntu/ (2) https://linuxhint.com/install-qgis3-geospatial-ubuntu/ (the latter worked perfectly well in the fall of 2018). I also checked several threads on StackExchange (e. g. this one and this one).

UPD: After several unsuccessfull attempts to remove/purge QGIS I came to the following. Now, it seems, python3-qgis is in its newest version (the one demanded once by QGIS to be installed)

python3-qgis is already the newest version (1:3.6.1+28bionic-ubuntugis).

Now, with different releases of QGIS I face the following problems:

For https://qgis.org/ubuntu-ltr (3.4 Madeira)

python3-qgis is already the newest version (1:3.6.1+28bionic-ubuntugis).
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:
 qgis : Depends: gdal-abi-2-2-3
        Depends: libqgis-analysis3.4.6 but it is not going to be installed
        Depends: libqgis-app3.4.6 but it is not going to be installed
        Depends: python3-qgis (= 1:3.4.6+28bionic) but 1:3.6.1+28bionic-ubuntugis is to be installed
 qgis-plugin-grass : Depends: grass740
                     Depends: libqgis-app3.4.6 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

For https://qgis.org/ubuntu (3.6 Noosa)

python3-qgis is already the newest version (1:3.6.1+28bionic-ubuntugis).
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:
 qgis : Depends: gdal-abi-2-2-3
        Depends: python3-qgis (= 1:3.6.1+28bionic) but 1:3.6.1+28bionic-ubuntugis is to be installed
 qgis-plugin-grass : Depends: grass740
E: Unable to correct problems, you have held broken packages.

For https://qgis.org/ubuntugis (3.6 Noosa / Release with ubuntugis-unstable dependencies)

python3-qgis is already the newest version (1:3.6.1+28bionic-ubuntugis).
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:
 qgis : Depends: python3-qgis (= 3.4.6+dfsg-1~bionic1) but 1:3.6.1+28bionic-ubuntugis is to be installed
E: Unable to correct problems, you have held broken packages.

UPD2: I tried sudo apt-get --purge remove python3-qgis and then, again, sudo apt-get install qgis python3-qgis qgis-plugin-grass, which resulted in the following:

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:
 python3-qgis : Depends: python3-qgis-common (= 3.4.6+dfsg-1~bionic1) but 1:3.6.1+28bionic-ubuntugis is to be installed
E: Unable to correct problems, you have held broken packages.
  • 1
    have you tried a sudo apt-get purge? – DPSSpatial Apr 13 '19 at 22:02
  • Yes, I did `sudo apt purge qgis* python-qgis* --auto-remove' – Alexei Kouprianov Apr 14 '19 at 6:52
  • you use the same packages to remove/purge as you installed: python3-qgis, etc. – DPSSpatial Apr 14 '19 at 21:42
  • Yes, this i did too, and it didn't help in itself. It seems that I failed to specify the repo correctly (see my answer to the question posted yesterday). The correct repo's address solved the problem. – Alexei Kouprianov Apr 15 '19 at 4:25
8

According to ubuntugis documentation. "A convenient new command is available for adding Launchpad PPA (Personal Package Archive) repositories via the command line: add-apt-repository."

For the stable PPA:

sudo add-apt-repository ppa:ubuntugis/ppa

Add this PPA and remove from /etc/apt/sources.list the sentences:

deb https://qgis.org/ubuntugis/ bionic main
deb-src https://qgis.org/ubuntugis/ bionic main

After that install QGIS:

sudo apt update
sudo apt install qgis python3-qgis qgis-plugin-grass

In case of key errors you can follow this instructions according to qgis.

Add the qgis.org repository public key:

wget -O - https://qgis.org/downloads/qgis-2019.gpg.key | gpg --import
gpg --fingerprint 51F523511C7028C3

gpg --export --armor 51F523511C7028C3 | sudo apt-key add -

This work for me. If you're in the same issue you should try this.

| improve this answer | |
  • Great answer, thank you. I had to reinstall today from scratch on Ubuntu 18.04.3. My previous solution didn't work this time, and yours was the only one that worked. – Alexei Kouprianov Jan 27 at 23:17
7

It seems that I used a wrong string to indicate the repo's address. The correct strings for /etc/apt/sources.list are:

deb https://qgis.org/ubuntugis/ bionic main
deb-src https://qgis.org/ubuntugis/ bionic main

After editing /etc/apt/sources.list (with sudo nano /etc/apt/sources.list in my case), naturally,

$ sudo apt-get update

and

$ sudo apt-get install qgis python3-qgis qgis-plugin-grass

solved the problem.

| improve this answer | |
  • I have been struggling with this for a couple days now! Thank you for posting the answer. It worked like a charm. – Angela R. Jul 10 '19 at 23:58
  • Worked for me too. Thanks – algone Aug 15 '19 at 7:06
  • It arises the error E: Unable to locate package python3-qgis – Tekson Feb 15 at 1:47
0

This did it! All earlier suggestions with additions to /etc/apt/sources.list run into unmet dependencies. I got tired of the docker version, which has locked up my ubuntu box several times now, and has issues with the windowing.

18.04.4 LTS

| improve this answer | |
0

I had roughly the same problem on Ubuntu 18.04 LTS: apt states that I have broken dependencies. Yet it warns me every time, that a large group of packages are not necessary anymore so I should clear them with 'sudo apt autoremove'. I was reluctant to do just that, as I was afraid it would remove packages which are necessary for my development environment.

I did however follow the instructions to add the QGIS ppa repository.

Yet this did the magic ! QGIS installs fine after this.

Hope this helps.

| improve this answer | |

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.