3

I'm running on 16.04 and I'm trying to install various packages for development, namely libglib2.0-dev for a project I'm working on. But this isn't the only package that has done this lately. Getting MySQL installed this week was a pain. I keep getting the following:

The following packages have unmet dependencies:
 libglib2.0-dev : Depends: libglib2.0-0 (= 2.48.0-1ubuntu4) but 2.48.1-1~ubuntu16.04.1 is to be installed
                  Depends: libglib2.0-bin (= 2.48.0-1ubuntu4)
E: Unable to correct problems, you have held broken packages.

This is virtually the exact same thing that was happening with my MySQL installation. I've searched around and found some recommendations to use aptitude install and apt-get install -f but none of these have worked. I've also done the due dilligence of apt-get update and apt-get dist-upgrade as well as checking Main Server in Download From in Software & Updates. I tried sticking it in a bag of granola for a week, but it didn't seem to do anything.

Any idea what's going on? I see a few of these threads around with no real solutions.

As per suggestion, the output is of apt-cache policy alibglib2.0-dev libglib2.0-0 libglib2.0-bin is:

libglib2.0-dev:
  Installed: (none)
  Candidate: 2.48.0-1ubuntu4
  Version table:
     2.48.0-1ubuntu4 500
        500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages
libglib2.0-0:
  Installed: 2.48.1-1~ubuntu16.04.1
  Candidate: 2.48.1-1~ubuntu16.04.1
  Version table:
 *** 2.48.1-1~ubuntu16.04.1 100
        100 /var/lib/dpkg/status
     2.48.0-1ubuntu4 500
        500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages
libglib2.0-bin:
  Installed: 2.48.1-1~ubuntu16.04.1
  Candidate: 2.48.1-1~ubuntu16.04.1
  Version table:
 *** 2.48.1-1~ubuntu16.04.1 100
        100 /var/lib/dpkg/status
     2.48.0-1ubuntu4 500
        500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages
6
  • 1
    Can you please edit your question and add the output of apt-cache policy libglib2.0-dev libglib2.0-0 libglib2.0-bin ? – Byte Commander Sep 20 '16 at 20:03
  • I have done so. Does this data have some implication about the state of my packages? – Csteele5 Sep 20 '16 at 22:41
  • Does simply running sudo apt-get clean followed by retrying your original installation command solve it? You have had a PPA or something that provided newer versions of some libraries which got cached on your disk and are incompatible with the version you need. – Byte Commander Sep 20 '16 at 22:45
  • Neither clean nor autoclean solve the problem. The MySQL installation I'm talking about was a 5.6 installation, which required me to use the old packages from Wily. This is probably why I have some bad cached packages, but I would have thought that they would remove themselves with clean and/or autoclean. – Csteele5 Sep 21 '16 at 1:05
  • 1
    You need to open Software & Updates > Updates tab & enable the 1st. two, -security & -updates. Then update your sources & proceed. (- for reference see - packages.ubuntu.com/xenial-updates/libglib2.0-dev , it's a xenial-update package – doug Sep 21 '16 at 2:42
1

Unmet dependencies remain in your sources.list..u need to refresh in order to install further packages so here you go :

sudo rm /etc/apt/sources.list 

Then, type in

sudo software-properties-gtk 

enter image description here This will open software-properties-gtk and a newsources.list will be created automatically.

Then change the server to US or to any other server of your choice. You must enable repositories from the new dialog in order to create new sources.list.

Tick all the boxes then click on Revert then click close.

Need to restore default repositories

 sudo apt-get update && sudo apt-get dist-upgrade -y

(it is good practice to backup this file before installing to recover if such things happen)

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.