So, I am using Ubuntu 18.04.1 LTS and use Qgis 3.4 for GIS analysis. I had a week long pause using QGIS for about a week, and it was quite an unhappy surprise to find out this morning that the whole program had vanished from my OS! I cannot figure out anything else I could have done, but used the software update once as prompted so by the system and installing some new R-packages.

So, I tried re-installation of QGIS, and here come my old friends: dependency issues. Can anyone figure out what is going on here?

> sudo apt-get update && sudo apt-get install qgis python-qgis qgis-plugin-grass saga
Hit:1 http://fi.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://fi.archive.ubuntu.com/ubuntu bionic-updates InRelease             
Hit:3 http://fi.archive.ubuntu.com/ubuntu bionic-backports InRelease           
Hit:4 https://qgis.org/debian bionic InRelease                                 
Hit:5 http://ppa.launchpad.net/albertomilone/hamster-indicator/ubuntu 
bionic InRelease
Hit:6 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu 
bionic InRelease
Get:7 http://security.ubuntu.com/ubuntu bionic-security InRelease 
[83,2 kB]    
Fetched 83,2 kB in 1s (89,2 kB/s)                                
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
saga is already the newest version (2.3.1+dfsg-4~bionic0).
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:
python-qgis : Depends: libqgis-analysis3.4.2 but it is not going to be 
qgis : Depends: gdal-abi-2-2-3
       Depends: libqgis-analysis3.4.2 but it is not going to be 
       Depends: libqgis-app3.4.2 but it is not going to be installed
qgis-plugin-grass : Depends: libqgis-app3.4.2 but it is not going to 
be installed
Depends: grass740
E: Unable to correct problems, you have held broken packages.

I tried installing the missing packages, with no luck:

> sudo apt-get install gdal-abi-2-2-3 libqgis-analysis3.4.2 libqgis- 
app3.4.2 grass740
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package gdal-abi-2-2-3 is a virtual package provided by:
libgdal20 2.2.3+dfsg-2 [Not candidate version]

Package grass740 is a virtual package provided by:
grass-core 7.4.0-1 [Not candidate version]

E: Package 'gdal-abi-2-2-3' has no installation candidate
E: Package 'grass740' has no installation candidate


According to the advice by Heikki I switched the Debian repository to Ubuntugis. Then I removed my previous installation using:

sudo apt-get remove qgis python-qgis qgis-plugin-grass saga

Then I tried re-installation, but still get the same error. There is still the problem of libgis-analysis3.4.2, gdal-abi-2-2-3 and libgis-app3.4.2 being unmet dependencies that cannot be installed for some reason.

  • Since you are using UbuntuGIS, you should also be using the corresponding QGIS repo. "qgis.org/ubuntugis bionic main" Instead of the Debian repo you have. Commented Dec 10, 2018 at 12:07
  • I tried this but it did not fix the problem. Updated the attempt to the question.
    – mihy
    Commented Dec 10, 2018 at 13:45
  • And if you try without GRASS and SAGA? sudo apt-get update sudo apt-get install qgis python-qgis Commented Dec 10, 2018 at 15:30
  • It still gives the same error message.
    – mihy
    Commented Dec 10, 2018 at 18:30

4 Answers 4


In this specific case, you should remove the ubuntugis repository.

Then downgrade gdal (from 2.3.2 that came from ubuntugis) to version 2.2.3.

sudo apt install gdal-bin=2.2.3+dfsg-2 libgdal20=2.2.3+dfsg-2 libgdal-dev=2.2.3+dfsg-2 libgdal-java=2.2.3+dfsg-2 gdal-data=2.2.3+dfsg-2 python-gdal=2.2.3+dfsg-2 python3-gdal=2.2.3+dfsg-2

The install qgis from qgis.org/ubuntu repo:

sudo apt install libqgis-analysis3.4.2 libqgis-app3.4.2 python-qgis qgis qgis-plugin-grass

If you want to install saga, well, you also have to fix a minor problem in the version names of the opencv packages.

Install saga with:

sudo apt install libopencv-flann3.2=3.2.0+dfsg-4ubuntu0.1 libopencv-highgui3.2=3.2.0+dfsg-4ubuntu0.1 libopencv-ml3.2=3.2.0+dfsg-4ubuntu0.1 libopencv-core3.2=3.2.0+dfsg-4ubuntu0.1 libopencv-videoio3.2=3.2.0+dfsg-4ubuntu0.1 libopencv-imgcodecs3.2=3.2.0+dfsg-4ubuntu0.1 libopencv-imgproc3.2=3.2.0+dfsg-4ubuntu0.1 saga-common saga python-saga libsaga libsaga-dev You should end up with QGIS 3.4.2, GRASS and SAGA.

enter image description here

  • Hi, it worked for me except for the grass plugin. I'm luky because I don't use it. I received an error said missing dependecies for grass740. Thank you very much
    – ilFonta
    Commented Dec 16, 2018 at 23:26
  • To have GRASS supported in QGIS, try sudo apt install grass-core grass-doc libqgisgrass7-3.4.2 qgis-plugin-grass qgis-plugin-grass-common qgis-provider-grass and tell us which are the missing dependencies.
    – jgrocha
    Commented Dec 17, 2018 at 0:14
  • version numbers have changed here or there but the concept works : force-install the precise version they say "but it is not going to be installed". sudo apt install python3-qgis=3.4.8+dfsg-1~bionic0 - that seems to be pulling everything in.
    – Nikhil VJ
    Commented Jul 10, 2019 at 15:14

The Ubuntugis way is currently broken, because update cycles of Ubuntugis and QGIS are not in sync.

You have to wait for the next point release, or switch to the qgis ubuntu repo and remove all ubuntugis packages.

  • Well, now I feel stupid. The whole reason for this mess was that I was using the debian packages... Strange though, that they worked for me before. All works fine now. Thank you!
    – mihy
    Commented Dec 11, 2018 at 8:53
  • The qgis debian repo alone would have worked, but not together with the ubuntugis ppa. In fact, qgis debian and ubuntu repos share the same content, only qgis ubuntugis is different.
    – AndreJ
    Commented Dec 11, 2018 at 10:43
  • @AndreJ Are you aware of any proposed plans to fix these unsynced dependencies? thanks
    – Phil
    Commented Mar 11, 2019 at 9:51
  • No, there are no plans, because both projects (QGIS and ubuntugis) don't have enough manpower to do so. Feel free to volunteer ... The nightly packages are fixed earlier, but might have other issues. Or disable the ubuntugis ppa once you have installed a proper working QGIS version until the next QGIS point release.
    – AndreJ
    Commented Mar 11, 2019 at 11:08
  • 1
    How do I remove the ubuntugis packages? I tried sudo apt-get remove ubuntugis but it found nothing. How do I find the packages to remove?
    – edge-case
    Commented Aug 6, 2019 at 18:21

I think the original poster's problem may have been because they included gdal-abi-x in their sudo apt-get install command. Apparently gdal-abi is a virtual package; not sure what that means but apt may have crapped out when it couldn't find gdal-abi. The original poster may have had more success if they left gdal-abi out and installed all the other missing dependencies, then tried installing qgis again.

    e.g. sudo apt-get install libqgis-analysis3.4.2 libqgis-app3.4.2 ... (my error message said I needed libqgis-core, libqgis-gui, and a bunch more)
         sudo apt-get install qgis

This whole thing just happened to me - I had QGIS 3.8 Zanzibar running just fine on my computer until it disappeared. I am almost positive that it disappeared because I ran sudo apt autoremove. I was installing R and a number of associated packages (adding repositories and subsequently running apt update and apt upgrade), and apt prompted me to run autoremove to clear a list of packages that were "installed and are no longer required". The message listed a number of packages that I thought were familiar looking, but I figured it was safe... well, QGIS was no longer installed on my computer after I ran autoremove - so my current understanding is that autoremove is not "safe."

I found this thread and added the UbuntuGIS repository to my list (with the debian & ubuntu repositories), but that didn't work for me.

With some guidance from https://askubuntu.com/questions/995435/apt-autoremove-trying-to-remove-essential-packages/1171212#1171212, I was able to get QGIS back on my computer by leaving the terminal open after I ran sudo apt-get install qgis (which gave me a similar error message as the original poster) - so I could see which dependencies were keeping it from installing. Then I opened synaptic package manager (installed through the software center), and installed all the dependencies I could find. Gdal-abi was the only one I couldn't find - but it didn't appear to matter in the end - after installing the other dependencies, qgis installed through synaptic. Gdal appears to run fine (I'm crossing my fingers) - the gdal slope algorithm worked successfully on a dem.

Somewhere in my [very] limited understanding of things, I wonder if installing libgdal1-dev made apt think that my current qgis and gdal installations were unnecessary (I installed libgdal1-dev while I was installing some spatial analysis packages for R - recommended by https://www.youtube.com/watch?v=syBPX0a4THA).

Thankfully my plugins and profiles were reincarnated - I don't understand enough about linux software installation but apt autoremove didn't touch ../.local/share/QGIS/QGIS3/profiles.


That happened to me after I installed rasterio and followed blindly their installation steps.

$ sudo add-apt-repository ppa:ubuntugis/ppa
$ sudo apt-get update
$ sudo apt-get install python-numpy gdal-bin libgdal-dev
$ pip install rasterio

That's a bad move, as QGIS disappeared.

To get it back, I deactivated the ubuntugis ppa, and uninstalled gdal-bin, libgdal-dev and gdal-data.

Then : sudo apt-get autoremove

And finally I could install QGIS back.

You have to uninstall all the packages that came with ubuntugis, but gdal-data was hard to find as I didn't install it manually. Luckily its name started with gdal.

And for the people who want use QGIS and have rasterio installed, follow rasterio's instructions without adding the ubuntugis ppa !

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.