3

Trying to install GTK as it was required by a another package.

So I ran apt-get install libgtk-3-dev

But getting unmet dependencies error.

Output

  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:
 libgtk-3-dev : Depends: libgdk-pixbuf2.0-dev (>= 2.30.0) but it is not going to be installed
                Depends: libpango1.0-dev (>= 1.36.7) but it is not going to be installed
                Depends: libcairo2-dev (>= 1.14.0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I know that this error usually happents due to broken package. But apt-get install -f show no problem.

Output of apt-get install -f

Reading package lists... Done Building dependency tree
Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Also no output for apt-mark showhold Output for apt-cache of involde package sudo apt-cache policy libgtk-3-dev

 ibgtk-3-dev:
  Installed: (none)  
  Candidate: 3.16.7-0ubuntu3  
  Version table:  
     3.16.7-0ubuntu3 0  
        500 http://in.archive.ubuntu.com/ubuntu/ wily/main i386 Packages

apt-cache policy libgdk-pixbuf2.0-dev

 libgdk-pixbuf2.0-dev:  
  Installed: (none)  
  Candidate: 2.32.1-1  
  Version table:  
     2.32.1-1 0  
        500 http://in.archive.ubuntu.com/ubuntu/ wily/main i386 Packages  

apt-cache policy libpango1.0-dev

libpango1.0-dev:  
  Installed: (none)  
  Candidate: 1.36.8-3  
  Version table:  
     1.36.8-3 0  
        500 http://in.archive.ubuntu.com/ubuntu/ wily/main i386 Packages 

apt-cache policy libcairo2-dev

libcairo2-dev:  
  Installed: (none)  
  Candidate: 1.14.2-2ubuntu2  
  Version table:  
     1.14.2-2ubuntu2 0  
        500 http://in.archive.ubuntu.com/ubuntu/ wily/main i386 Packages  

sudo apt-get check and sudo dpkg -C has no output.
Output of sudo apt-get update

Reading package lists... Done
Building dependency tree       
Reading state information... Done  
Hit http://ppa.launchpad.net wily InRelease                                   
Hit http://ppa.launchpad.net wily InRelease                                    
Hit http://ppa.launchpad.net wily/main i386 Packages                           
Hit http://in.archive.ubuntu.com wily InRelease                               
Hit http://ppa.launchpad.net wily/main Translation-en
Hit http://ppa.launchpad.net wily/main i386 Packages
Hit http://ppa.launchpad.net wily/main Translation-en              
Hit http://in.archive.ubuntu.com wily/main i386 Packages
Hit http://in.archive.ubuntu.com wily/universe i386 Packages                   
Hit http://in.archive.ubuntu.com wily/restricted i386 Packages                 
Hit http://in.archive.ubuntu.com wily/multiverse i386 Packages                 
Hit http://in.archive.ubuntu.com wily/main Translation-en                      
Hit http://in.archive.ubuntu.com wily/multiverse Translation-en                
Hit http://in.archive.ubuntu.com wily/restricted Translation-en                
Hit http://in.archive.ubuntu.com wily/universe Translation-en                  
Reading package lists... Done 

Output for cat /etc/apt/sources.list

deb http://in.archive.ubuntu.com/ubuntu/ wily main universe restricted multiverse

EDIT: I think libpng12-0 is causing the problem tried to install libpng12-dev using apt-get but got this error

The following packages have unmet dependencies:  
 libpng12-dev : Depends: libpng12-0 (= 1.2.51-0ubuntu3) but   1.2.51-0ubuntu3.15.10.2 is to be installed

Tried installing the latest version of libpng12-0 from source but still showing the same error.

EDIT2(Sollution?): Didn't do nothing much just installed libgtk-3-dev using aptitude and accepted the solution to downgrade libpng12-0 and it worked

1 Answers1

2

This isn't a case of existing broken dependencies (which apt-get install -f would attempt to fix), it's that it can't get the packages it needs to install the new package.

This could happen for a few reasons:

  • You have an active repository that is suggesting a newer version of libgtk-3-dev (or its direct dependencies) which doesn't also include the right versions of the other dependencies.

    This can be a common issue for people who install tons of PPAs. Some versions get bumped so high that dependencies can't be worked out sufficiently.

  • You don't have the right dependencies enabled (maybe something's in universe?)
  • You haven't run an apt-get update recently?
  • It's a straight-up bug in libgtk-3-dev (or one of its dependencies). File a report on Launchpad.

If you're just compiling stuff, a "quick" workaround for problems like this is to spin up a clean LXC (or other) virtual machine. This will let you start afresh without using up too much disk space.

Oli
  • 293,335