3

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?

5 Answers 5

2

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

6
  • 2
    Please edit your answer and change "reintsall" to "reinstall" as other people copy-paste sulutions in code... ;-)
    – Fabby
    Nov 20, 2014 at 16:31
  • Oh, and I'd also appreciate if you upvote my answer as other people will find aptitude a real livesaver as it is an "Ubuntu Software Center" in a terminal. (Don't delete it: keep it around if you do something careless next time!)
    – Fabby
    Nov 20, 2014 at 17:04
  • Thanks didn't notice the type. Regarding upvoting - I'm sure those who found it helpful will do that :)
    – Uri
    Nov 20, 2014 at 17:09
  • Unfortunately, it's on the bottom, below the answer that is really not helpful, but I bow to your wisdom... :(
    – Fabby
    Nov 20, 2014 at 17:12
  • apt --fix-broken install
    – Timo
    Apr 25, 2021 at 15:45
1

I had a similar issue. multiple areas of the libegl1-mesa package were missing. This prevented apt-get update from working, and I couldn't install new packages... was a nightmare. I tried everything above, as well as launching in recovery mode and running the dpkg option to fix broken packages. Nothing worked.

I finally corrected the issue with a slight variation of the above commands in terminal:

sudo apt-get -f install --fix-missing

Followed by:

sudo apt-get update

All that research, for such a painfully simple resolution. God I love Ubuntu. Hope this Helps.

1
  • That didn't help, I still have an error... the following packages have unmet dependencies: libeg1-mesa0 : Depends: libglapi-mesa
    – Liker777
    Jun 4, 2023 at 18:31
0

As the error shows, try executing apt-get -f install to fix unmet dependencies.

5
  • I did that too and got similar error messages (see my update).
    – Uri
    Nov 20, 2014 at 11:12
  • What packages have you tried to remove?
    – segarci
    Nov 20, 2014 at 11:16
  • The ones listed in the error, and other ones. Always getting the same message.
    – Uri
    Nov 20, 2014 at 11:17
  • I think sudo apt-get remove libgl1-mesa-dri can help. Can you check it?
    – segarci
    Nov 20, 2014 at 11:21
  • Same error: The following packages have unmet dependencies: libegl1-mesa : Depends: libgl1-mesa-dri (= 10.5~git1411191810.9460cd~gd~u) but it is not going to be installed libgbm1 : Depends: libgl1-mesa-dri (= 10.5~git1411191810.9460cd~gd~u) but it is not going to be installed libgl1-mesa-glx : Depends: libgl1-mesa-dri (= 10.5~git1411191810.9460cd~gd~u) but it is not going to be installed xorg : Depends: libgl1-mesa-dri but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
    – Uri
    Nov 20, 2014 at 11:41
0

Basically, you removed too much. Stop removing and start adding back in again or you'll end up with a non-working OS! :-(

Currently Unity doesn't even want to open because it is missing important files, hence the black cursor...

When you see the black cursor, press [ctrl][alt][f1] and login as the admin user. There you will have a terminal (no GUI, that's broken already).

Try:

sudo apt-get install aptitude

That is a character-based intelligent package manager which allows you to take more informed decisions. If even that fails, you'd better restore your latest system backup or if you don't have one, re-install Ubuntu if you have a separate "home" partition. If you just have one huge drive and no separate "home", reinstall without formatting the drive or you'll loose everything!

To start using aptitude just do a:

sudo aptitude
2
  • libgl1-mesa is one of the libraries used by OpenGL, so needed by Ubuntu itself to draw windows and other very important stuff! Use Aptitude to add that back in ASAP so that your GUI comes back on-line...
    – Fabby
    Nov 20, 2014 at 14:43
  • 1
    I managed to install aptitude but was quite lost in it... see my answer.
    – Uri
    Nov 20, 2014 at 16:07
0

I am going to provide my solution because none of the others worked.

1. I had to check and remove the sources that was pointing at the conflict. In my case sudo rm /etc/apt/sources.list.d/tuxedo-computers.list fixed the issue. sudo apt update obviously to apply the changes. There are other ways for that, as mentioned here: How can PPAs be removed?

2. Show the versions that can be installed etc.

sudo apt-cache policy libgbm1
  Installed: 22.3.7-0+tux1
  Candidate: 22.3.7-0+tux1
  Version table:
 *** 22.3.7-0+tux1 100
        100 /var/lib/dpkg/status
     22.2.5-0ubuntu0.1 500
        500 http://ch.archive.ubuntu.com/ubuntu kinetic-updates/main amd64 Packages
     22.2.1-1ubuntu1 500
        500 http://ch.archive.ubuntu.com/ubuntu kinetic/main amd64 Packages

as you can see, it's still installed but not in the sources list anymore.

  1. Then forcing it to install the newest current version.

    sudo apt-get -f reinstall libgbm1=22.2.5-0ubuntu0.1

And 🎉, everything works again. :-)

2
  • How did you rm command work without sudo?
    – David
    Apr 17, 2023 at 9:42
  • Good catch. Fixed it.
    – Joe Eifert
    Apr 18, 2023 at 6:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .