1

I have added Oibaf and Paulo Diases repositories and upgraded my system which resulted in broken apt. I can't ppa-purge any of them.

This happens whenever I try to use any apt command. apt --fix-broken install doesn't work:

sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libgl1-mesa-dev : Depends: libgl1-mesa-glx (= 1:17.2~git170422012800.d682f8a~z~padoka0) but 17.2~git1704220730.d682f8~gd~z is installed
 libgl1-mesa-glx : Depends: libglapi-mesa (= 17.2~git1704220730.d682f8~gd~z) but 1:17.2~git170422012800.d682f8a~z~padoka0 is installed
                   Breaks: libgl1-mesa-glx:i386 (!= 17.2~git1704220730.d682f8~gd~z) but 1:17.2~git170422012800.d682f8a~z~padoka0 is installed
 libgl1-mesa-glx:i386 : Breaks: libgl1-mesa-glx (!= 1:17.2~git170422012800.d682f8a~z~padoka0) but 17.2~git1704220730.d682f8~gd~z is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Output of ppa-purge:

sudo ppa-purge ppa:paulo-miguel-dias/mesa
Updating packages lists
PPA to be removed: paulo-miguel-dias mesa
Package revert list generated:
 libgl1-mesa-glx:amd64/zesty mesa-vdpau-drivers:amd64/zesty 
mesa-vdpau-drivers:i386/zesty

Disabling paulo-miguel-dias PPA from 
/etc/apt/sources.list.d/paulo-miguel-dias-ubuntu-mesa-zesty.list
Updating packages lists
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Selected version '17.2~git1704230730.070072~gd~z' (Updated and Optimized Open Graphics Drivers:17.04/zesty [amd64]) for 'libgl1-mesa-glx'
Selected version '17.2~git1704230730.070072~gd~z' (Updated and Optimized Open Graphics Drivers:17.04/zesty [amd64]) for 'libglapi-mesa' because of 'libgl1-mesa-glx'
Selected version '17.2~git1704230730.070072~gd~z' (Updated and Optimized Open Graphics Drivers:17.04/zesty [amd64]) for 'mesa-vdpau-drivers'
Selected version '17.2~git1704230730.070072~gd~z' (Updated and Optimized Open Graphics Drivers:17.04/zesty [i386]) for 'mesa-vdpau-drivers:i386'
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libgl1-mesa-dev : Depends: libgl1-mesa-glx (= 1:17.2~git170422012800.d682f8a~z~padoka0) but 17.2~git1704230730.070072~gd~z is to be installed
 libgl1-mesa-glx : Depends: libglapi-mesa (= 17.2~git1704230730.070072~gd~z) but 1:17.2~git170422012800.d682f8a~z~padoka0 is to be installed
                   Breaks: libgl1-mesa-glx:i386 (!= 17.2~git1704230730.070072~gd~z) but 1:17.2~git170422012800.d682f8a~z~padoka0 is to be installed
 libgl1-mesa-glx:i386 : Breaks: libgl1-mesa-glx (!= 1:17.2~git170422012800.d682f8a~z~padoka0) but 17.2~git1704230730.070072~gd~z is to be installed
 mesa-vdpau-drivers : Depends: libomxil-bellagio0 but it is not going to be installed
 mesa-vdpau-drivers:i386 : Depends: libomxil-bellagio0:i386 but it is not going to be installed
                           Depends: libxv1:i386 but it is not going to be installed
                           Depends: libxvmc1:i386 but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution)

Dependency hell doesn't seem to end when trying to manually solve the problem:

sudo apt-get install libgl1-mesa-glx=17.0.3-1ubuntu1 libgl1-mesa-dev=17.0.3-1ubuntu1 libgl1-mesa-glx:i386=17.0.3-1ubuntu1 libglapi-mesa=17.0.3-1ubuntu1Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libgl1-mesa-dev : Depends: mesa-common-dev (= 17.0.3-1ubuntu1) but 1:17.2~git170422012800.d682f8a~z~padoka0 is to be installed
 libgl1-mesa-glx:i386 : Depends: libglapi-mesa:i386 (= 17.0.3-1ubuntu1) but 1:17.2~git170422012800.d682f8a~z~padoka0 is to be installed
 libglapi-mesa : Breaks: libglapi-mesa:i386 (!= 17.0.3-1ubuntu1) but 1:17.2~git170422012800.d682f8a~z~padoka0 is to be installed
 libglapi-mesa:i386 : Breaks: libglapi-mesa (!= 1:17.2~git170422012800.d682f8a~z~padoka0) but 17.0.3-1ubuntu1 is to be installed
 libgles2-mesa : Depends: libglapi-mesa (= 1:17.2~git170422012800.d682f8a~z~padoka0) but 17.0.3-1ubuntu1 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

output of cat /etc/apt/sources.list :

# deb cdrom:[budgie-remix 16.10 _Budgie-remix_ -  amd64 (20161013)]/ xenial main restricted

# deb cdrom:[budgie-remix 16.10 _Budgie-remix_ -  amd64 (20161013)]/ yakkety contrib main non-free

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://hr.archive.ubuntu.com/ubuntu/ zesty main restricted
# deb-src http://hr.archive.ubuntu.com/ubuntu/ yakkety main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://hr.archive.ubuntu.com/ubuntu/ zesty-updates main restricted
# deb-src http://hr.archive.ubuntu.com/ubuntu/ yakkety-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://hr.archive.ubuntu.com/ubuntu/ zesty universe
# deb-src http://hr.archive.ubuntu.com/ubuntu/ yakkety universe
deb http://hr.archive.ubuntu.com/ubuntu/ zesty-updates universe
# deb-src http://hr.archive.ubuntu.com/ubuntu/ yakkety-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://hr.archive.ubuntu.com/ubuntu/ zesty multiverse
# deb-src http://hr.archive.ubuntu.com/ubuntu/ yakkety multiverse
deb http://hr.archive.ubuntu.com/ubuntu/ zesty-updates multiverse
# deb-src http://hr.archive.ubuntu.com/ubuntu/ yakkety-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://hr.archive.ubuntu.com/ubuntu/ zesty-backports main restricted universe multiverse
# deb-src http://hr.archive.ubuntu.com/ubuntu/ yakkety-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu yakkety partner
# deb-src http://archive.canonical.com/ubuntu yakkety partner

deb http://security.ubuntu.com/ubuntu zesty-security main restricted
# deb-src http://security.ubuntu.com/ubuntu yakkety-security main restricted
deb http://security.ubuntu.com/ubuntu zesty-security universe
# deb-src http://security.ubuntu.com/ubuntu yakkety-security universe
deb http://security.ubuntu.com/ubuntu zesty-security multiverse
# deb-src http://security.ubuntu.com/ubuntu yakkety-security multiverse

Output of sudo apt --fix-broken install:

    Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
 libgl1-mesa-dev : Depends: libgl1-mesa-glx (= 1:17.2~git170422012800.d682f8a~z~padoka0) but 17.2~git1704220730.d682f8~gd~z is installed
 libgl1-mesa-glx : Depends: libglapi-mesa (= 17.2~git1704220730.d682f8~gd~z) but 1:17.2~git170422012800.d682f8a~z~padoka0 is installed
                   Breaks: libgl1-mesa-glx:i386 (!= 17.2~git1704220730.d682f8~gd~z) but 1:17.2~git170422012800.d682f8a~z~padoka0 is installed
 libgl1-mesa-glx:i386 : Breaks: libgl1-mesa-glx (!= 1:17.2~git170422012800.d682f8a~z~padoka0) but 17.2~git1704220730.d682f8~gd~z is installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

Output of sudo dpkg --configure -a:

dpkg: dependency problems prevent configuration of libgl1-mesa-dev:amd64:
 libgl1-mesa-dev:amd64 depends on libgl1-mesa-glx (= 1:17.2~git170422012800.d682f8a~z~padoka0); however:
  Version of libgl1-mesa-glx:amd64 on system is 17.2~git1704220730.d682f8~gd~z.

dpkg: error processing package libgl1-mesa-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: error processing package libgl1-mesa-glx:i386 (--configure):
 package libgl1-mesa-glx:i386 1:17.2~git170422012800.d682f8a~z~padoka0 cannot be configured because libgl1-mesa-glx:amd64 is at a different version (17.2~git1704220730.d682f8~gd~z)
Errors were encountered while processing:
 libgl1-mesa-dev:amd64
 libgl1-mesa-glx:i386

/etc/apt/sources.list.d/ :

# deb http://ppa.launchpad.net/budgie-remix/ppa/ubuntu zesty main # disabled on upgrade to zesty
# deb-src http://ppa.launchpad.net/budgie-remix/ppa/ubuntu yakkety main
deb http://ppa.launchpad.net/budgie-remix/ppa/ubuntu yakkety main
# deb-src http://ppa.launchpad.net/budgie-remix/ppa/ubuntu yakkety main
# deb http://ppa.launchpad.net/budgie-remix/ppa/ubuntu zesty main # disabled on upgrade to zesty
# deb-src http://ppa.launchpad.net/budgie-remix/ppa/ubuntu yakkety main
deb http://ppa.launchpad.net/danielrichter2007/grub-customizer/ubuntu zesty main
# deb-src http://ppa.launchpad.net/danielrichter2007/grub-customizer/ubuntu zesty main
deb http://ppa.launchpad.net/danielrichter2007/grub-customizer/ubuntu zesty main
# deb-src http://ppa.launchpad.net/danielrichter2007/grub-customizer/ubuntu zesty main
deb http://ppa.launchpad.net/morphis/anbox-support/ubuntu zesty main
# deb-src http://ppa.launchpad.net/morphis/anbox-support/ubuntu zesty main
deb http://ppa.launchpad.net/morphis/anbox-support/ubuntu zesty main
# deb-src http://ppa.launchpad.net/morphis/anbox-support/ubuntu zesty main
deb http://ppa.launchpad.net/oibaf/graphics-drivers/ubuntu zesty main
# deb-src http://ppa.launchpad.net/oibaf/graphics-drivers/ubuntu zesty main
deb http://ppa.launchpad.net/oibaf/graphics-drivers/ubuntu zesty main
# deb-src http://ppa.launchpad.net/oibaf/graphics-drivers/ubuntu zesty main
# deb http://ppa.launchpad.net/oranchelo/oranchelo-icon-theme/ubuntu zesty main # disabled on upgrade to zesty
# deb-src http://ppa.launchpad.net/oranchelo/oranchelo-icon-theme/ubuntu yakkety main
deb http://ppa.launchpad.net/oranchelo/oranchelo-icon-theme/ubuntu yakkety main
# deb-src http://ppa.launchpad.net/oranchelo/oranchelo-icon-theme/ubuntu yakkety main
# deb http://ppa.launchpad.net/oranchelo/oranchelo-icon-theme/ubuntu zesty main # disabled on upgrade to zesty
# deb-src http://ppa.launchpad.net/oranchelo/oranchelo-icon-theme/ubuntu yakkety main
# deb-src http://ppa.launchpad.net/oranchelo/oranchelo-icon-theme/ubuntu zesty main
# deb-src http://ppa.launchpad.net/oranchelo/oranchelo-icon-theme/ubuntu zesty main
# deb http://ppa.launchpad.net/paulo-miguel-dias/mesa/ubuntu zesty main
# deb-src http://ppa.launchpad.net/paulo-miguel-dias/mesa/ubuntu zesty main
# deb http://ppa.launchpad.net/paulo-miguel-dias/mesa/ubuntu zesty main
# deb-src http://ppa.launchpad.net/paulo-miguel-dias/mesa/ubuntu zesty main
deb http://ppa.launchpad.net/webupd8team/sublime-text-2/ubuntu zesty main
# deb-src http://ppa.launchpad.net/webupd8team/sublime-text-2/ubuntu zesty main
deb http://ppa.launchpad.net/webupd8team/sublime-text-2/ubuntu zesty main
# deb-src http://ppa.launchpad.net/webupd8team/sublime-text-2/ubuntu zesty main
deb http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu zesty main
# deb-src http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu zesty main
deb http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu zesty main
# deb-src http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu zesty main
  • 1
    Have you tried what it says to run? apt --fix-broken install ? – Ravexina Apr 23 '17 at 15:21
  • 1
    I would do something like this: create two directory mkdir ~/tmpsrclist and mkdir ~/tmpaptlist, move things that are broken there: sudo mv /etc/apt/sources.list.d/* ~/tmpsrclist and sudo mv /var/lib/apt/lists/* ~/tmpaptlist; update your lists: sudo apt update then run: apt --fix-broken install, let me know if it worked for you ;) – Ravexina Apr 23 '17 at 15:25
  • Yes, I've tried apt --fix-broken install And your second solution didn't work either :(. Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... failed. The following packages have unmet dependencies: E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages. E: Unable to correct dependencies – user140345 Apr 23 '17 at 15:35
  • After doing second instruction, what are you getting? and from running which command? give us a little bit more information, e.g; was apt update successful? or other commands? did you get any error? – Ravexina Apr 23 '17 at 15:37
  • 1
    The above command didn't worked because we moved those file somewhere else: run sudo cp ~/tmpsrclist/* /etc/apt/sources.list.d/ to bring them back, then you can add those output too ;) – Ravexina Apr 23 '17 at 16:00
4

A few weeks ago, I had similar problems with oibaf ppa. Even when ppa-purge fails, you can revert back to official Ubuntu repo version. Especially because the dependencies of these packages aren't huge.

So, I suggest just noting the package names from the output shown, and use apt policy package-name command to list version from respective repository. For example, apt policy libgl1-mesa-dev may return like this

apt policy libgl1-mesa-dev 
libgl1-mesa-dev: 
Installed: 1:17.2~git170422012800.d682f8a~z~padoka0 
Candidate: 1:17.2~git170422012800.d682f8a~z~padoka0 
Version table: 
*** 1:17.2~git170422012800.d682f8a~z~padoka0 100 
100 /var/lib/dpkg/status 
17.2~git1704230730.070072~gd~z 500 
500 ppa.launchpad.net/oibaf/… zesty/main amd64 Packages 
17.0.3-1ubuntu1 500 
500 hr.archive.ubuntu.com/ubuntu zesty/main amd64 Packages

You can see that the latest version from official repository is 17.0.3-1ubuntu1. Note this version. Do this for all of the offending packages.

Once you've gathered all package names with official latest version, you can use this type of command sudo apt install libgl1-mesa-dev=version for all packages. It'll force apt to install the packages you mentioned the version.

For more package appears to say the same thing include those packages too.

After that and with some luck, you should be on last official repository. Then use ppa-purge to gracefully purge the both ppas.


We've discussed the issue on chat and it appears this command worked.

sudo apt-get install libgl1-mesa-glx=17.0.3-1ubuntu1 libgl1-mesa-dev=17.0.3-1ubuntu1 libgl1-mesa-glx:i386=17.0.3-1ubuntu1 libglapi-mesa=17.0.3-1ubuntu1 mesa-common-dev=17.0* libglapi-mesa:i386=17.0* libglapi-mesa=17.0* libglapi-mesa=17.0* libgles2-mesa=17.0*

Advice I'd advice to always have aptitude installed. If it's installed, ppa-purge may work more appropriately.

Thanks Ravexina was trying to help before i joined the chat room. So, thanks to him especially for working on various other tricks.


Another trick discovered recently

I recently discovered a more convenient way to downgrade/escape from dependency hell without specifying the version. I'm listing the steps

You'd remove the ppa and identify the packages that are creating the dependency problem from that ppa. Those are usually the packages you'll find in following style of messages

 libgl1-mesa-dev : Depends: libgl1-mesa-glx (= 1:17.2~git170422012800.d682f8a~z~padoka0) but 17.2~git1704220730.d682f8~gd~z is installed

You know that the package is libgl1-mesa-glx which is higher than the package apt find to match with requeste libgl1-mesa-dev, creating a problem.

Once you identify the problematic packages from that ppa, you'll use this apt to install package from other repo without using release name instead of the version string like this (for 16.04, the release name is xenial)

sudo apt install libgl1-mesa-dev/xenial

This will select a version from a repository having the archive name xenial (Note that, all ppa have this xenial as archive name). Since the installed package are not from xenial archive (It was, but after removal of the ppa, it's from unknown release for apt), apt will select a version that comes with same release. Most of the time, it's the official repository comes with Ubuntu (unless you have that package from other ppa or repo).

Surprisingly, apt act more intelligently this case. Instead of selecting the most highest version for dependency of libgl1-mesa-dev, it will select highest version from specified release which will be from official repo, even if that needs downgrading of other installed packages, which effectively resolves the problem!

  • 1
    You just saved me from reinstalling my OS. Thank you! – dcmm88 Sep 23 '17 at 0:49

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.