apt-get Dependency Issue – Fixing libegl1-mesa Error

aptdependenciespackage-management

tl;dr: Every apt-get command fails because of this:

Depends: libgl1-mesa-dri (= 10.5~git1411191810.9460cd~gd~u) but 10.4~git1411171930.920f87~gd~u is to be installed

I cannot remove or install anything. What should I do?


Long story:

I'm using Ubuntu 14.10 and yesterday I tried following this manual: https://github.com/MobileChromeApps/mobile-chrome-apps/blob/master/docs/Installation.md

And ended up messing something. I have a stop sign next to the clock on the taskbar which says "Please run package manager" and "packages have unmet dependencies"

sudo apt-get upgrade stopped working (update seems to be working however).

I tried to remove the packages but sudo apt-get remove stopped working, This is the error I get:

Reading package lists... Done Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies: 
  libegl1-mesa : Depends: libgl1-mesa-dri (=10.5~git1411191810.9460cd~gd~u) but 10.4~git1411171930.920f87~gd~u is to be installed
  libgbm1 : Depends: libgl1-mesa-dri (= 10.5~git1411191810.9460cd~gd~u) but 10.4~git1411171930.920f87~gd~u is to be installed
  libgl1-mesa-glx : Depends: libgl1-mesa-dri (= 10.5~git1411191810.9460cd~gd~u) but 10.4~git1411171930.920f87~gd~u is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Running sudo apt-get insall -f gives this:

  libegl1-mesa : Depends: libgl1-mesa-dri (= 10.5~git1411191810.9460cd~gd~u) but 10.4~git1411171930.920f87~gd~u is installed
  libgbm1 : Depends: libgl1-mesa-dri (= 10.5~git1411191810.9460cd~gd~u) but 10.4~git1411171930.920f87~gd~u is installed
  libgl1-mesa-glx : Depends: libgl1-mesa-dri (= 10.5~git1411191810.9460cd~gd~u) but 10.4~git1411171930.920f87~gd~u is installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

using dpkg also doesn't work:

$ sudo dpkg -r libegl1-mesa
dpkg: dependency problems prevent removal of libegl1-mesa:amd64:
  libwayland-egl1-mesa:amd64 depends on libegl1-mesa (= 10.5~git1411191810.9460cd~gd~u). 
  libgstreamer-plugins-bad1.0-0:amd64 depends on libegl1-mesa (>= 7.8.1) | libegl1-x11; however:
    Package libegl1-mesa:amd64 is to be removed.
    Package libegl1-x11 is not installed.
    Package libegl1-mesa:amd64 which provides libegl1-x11 is to be removed.
  libcogl20:amd64 depends on libegl1-mesa (>= 7.8.1) | libegl1-x11; however:
    Package libegl1-mesa:amd64 is to be removed.
    Package libegl1-x11 is not installed.
    Package libegl1-mesa:amd64 which provides libegl1-x11 is to be removed.
  libegl1-mesa-drivers:amd64 depends on libegl1-mesa (=> 10.5~git1411191810.9460cd~gd~u).
  libqt5gui5:amd64 depends on libegl1-mesa (>= 7.8.1) | libegl1-x11; however:
    Package libegl1-mesa:amd64 is to be removed.
    Package libegl1-x11 is not installed.
    Package libegl1-mesa:amd64 which provides libegl1-x11 is to be removed.
  xserver-xorg-core depends on libegl1-mesa | libegl1; ho
dpkg: error processing package libegl1-mesa:amd64 (--remove): dependency problems - not removing Errors were encountered while processing:
  libegl1-mesa:amd64

Update:

Somehow I solved it, I'm not exactly sure how, so I'll describe everything I did:

Typed software-properties-gtk in terminal and checked all checkboxes on ubuntu software tab, then went to other software, unchecked and removed all checkboxes that said "disabled on utopic", checked all that made sense to me (chrome dropbox etc'), then did sudo apt-get install -f and everything seemed to work again.

However – after reoboting, I see a black screen with a flashing cursor. Maybe a graphics driver problem?

Best Answer

Running sudo apt-get install --reinstall ubuntu-dekstop fixed everything.

Related Question