1

I'm updating on Ubuntu 14.04 , but I have these tracebacks for QGis :

Preparing to unpack .../qgis-provider-grass_2.8.4+20trusty_amd64.deb ...
dpkg-divert: error: `diversion of /usr/bin/qgis to /usr/bin/qgis.bin by qgis-provider-grass' clashes with `diversion of /usr/bin/qgis to /usr/bin/qgis.bin by qgis-plugin-grass'
dpkg: error processing archive /var/cache/apt/archives/qgis-provider-grass_2.8.4+20trusty_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 2

and it finishes like this :

Errors were encountered while processing:
 /var/cache/apt/archives/qgis-provider-grass_2.8.4+20trusty_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

2 Answers 2

4

I ran into the same problem with the 2.8.4 update from 2.8.3. Here's how I fixed it:

You'll notice in the traceback it says

dpkg-divert: error: `diversion of /usr/bin/qgis to /usr/bin/qgis.bin by qgis-provider-grass' clashes with `diversion of /usr/bin/qgis to /usr/bin/qgis.bin by qgis-plugin-grass'

The divert functionality of dpkg is basically just a renaming of packages. In this case, the qgis-provider-grass package is trying to rename /usr/bin/qgis to /usr/bin/qgis.bin, but it found that this renaming is clashing with a similar rule put in place by qgis-plugin-grass.

The solution is, remove the existing divert, and allow the qgis-provider-grass to put it in again. This doesn't actually break anything (in the extreme case, you can remove the divert altogether and then you'll be calling /usr/bin/qgis instead of /usr/bin/qgis.bin)

To remove the divert, run

sudo dpkg-divert --remove --rename /usr/bin/qgis

You should see a message like this

Removing 'diversion of /usr/bin/qgis to /usr/bin/qgis.bin by qgis-plugin-grass'

Also, you'll want to do the same thing for qbrowser (you'll find that if you don't, another error like the one you're seeing will pop up):

sudo dpkg-divert --remove --rename /usr/bin/qbrowser

That's it! Now, fix all the broken packages in apt (they're not actually broken, but apt thinks they are because it couldn't run the divert rule):

sudo apt-get install -f
2

I had the same issue.

What worked for me was to remove all qgis and grass related packages (I used synaptic, it helped me to find them).

I then made a fresh install of the ltr following the instructions on http://www.qgis.org/en/site/forusers/alldownloads.html#debian-ubuntu. I made sure to only have the deb and deb-src of http://qgis.org/debian-ltr active in the sources.list

1
  • I had done that. i.e autoremove qgis* and grass* . But when I install, I still have the qgis-plugin-grass and qgis-provider-grass which yields an incompatibility error. Thanks for the advice.
    – iMitwe
    Dec 2, 2015 at 13:22

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.