6

While installing libgtk2.0-dev i'm receiving following error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libgtk2.0-dev : Depends: libglib2.0-dev (>= 2.27.3) but it is not going to be installed
                 Depends: libgdk-pixbuf2.0-dev (>= 2.21.0) but it is not going to be installed
                 Depends: libpango1.0-dev (>= 1.20) but it is not going to be installed
                 Depends: libatk1.0-dev (>= 1.29.2) but it is not going to be installed
                 Depends: libcairo2-dev (>= 1.6.4-6.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I tried lots of things like -f flag, synaptic, install them individually , install all dependency at once but everything failed.

Is libgtk2.0-dev is not supported on ubuntu 16.04 ?

EDIT: output of apt-cache policy libgtk2.0-dev libglib2.0-dev

libgtk2.0-dev:
  Installed: (none)
  Candidate: 2.24.30-1ubuntu1
  Version table:
     2.24.30-1ubuntu1 500
        500 http://mirror.dhakacom.com/ubuntu-archive xenial/main amd64 Packages
libglib2.0-dev:
  Installed: (none)
  Candidate: 2.48.0-1ubuntu4
  Version table:
     2.48.0-1ubuntu4 500
        500 http://mirror.dhakacom.com/ubuntu-archive xenial/main amd64 Packages
2
  • Please edit your question to include the output of apt-cache policy libgtk2.0-dev libglib2.0-dev Feb 17, 2017 at 15:47
  • @steeldriver I edited the question with output.
    – Al Mamun
    Feb 22, 2017 at 6:24

2 Answers 2

5

How i solved the problem: I tried to install those dependencies manually. First tried to install sudo apt-get install libglib2.0-dev but it gives following error:

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)

Then i tried to install glibs dependency along with glib: sudo apt-get install libglib2.0-dev libglib2.0-0=2.48.0-1ubuntu4

This time package installation successful.

After that i issued sudo apt-get install libgtk2.0-dev and it works!

1
  • It does not work for me running elementary Loki(16.04 Lts)
    – Reya276
    Feb 28, 2018 at 18:28
0

I too had this problem. But, since the version of libglib2.0-0 has now changed to 2.48.2-0ubuntu1 (was, at the time of the original answer,2.48.0-1ubuntu4), @Reya276, one has only to change version accordingly.

The full solution, presently for 16.04 lts, is:

sudo apt-get install libglib2.0-dev libglib2.0-0=2.48.2-0ubuntu1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.