9

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.
4
  • 1
    have you tried a sudo apt-get purge? Commented Apr 13, 2019 at 22:02
  • Yes, I did `sudo apt purge qgis* python-qgis* --auto-remove' Commented Apr 14, 2019 at 6:52
  • you use the same packages to remove/purge as you installed: python3-qgis, etc. Commented Apr 14, 2019 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. Commented Apr 15, 2019 at 4:25

3 Answers 3

14

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.

0
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.

1
  • It arises the error E: Unable to locate package python3-qgis Commented Feb 15, 2020 at 1:47
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.