Note about possible duplicate:
AFAIK, This is not a duplicate of How do I resolve unmet dependencies after adding a PPA? otherwise please prove it by solving the test problem I mention below using any answer from there.
Background:
I faced this problem before How to fix installation wine on Ubuntu 14.04.3LTS 64 bit. It was solved by manual/human review of all recursive dependencies of the target package (wine
).
Reproduce the problem (Test Case):
Let's create same situation quiet simplified with just 1 trouble package.
- Install fresh Ubuntu 14.04 on VirtualBox.
- Open
software-properties-gtk
and enablebackports
repository. Get last packages list
sudo apt-get update
Run
apt-get -s install wine
to confirm thatwine
can be installed.Install the troubling package
libcgmanager0
from backports$ apt-cache policy libcgmanager0 libcgmanager0: Installed: 0.24-0ubuntu5 Candidate: 0.24-0ubuntu7.5 Version table: 0.39-2ubuntu2~ubuntu14.04.1 0 100 http://dz.archive.ubuntu.com/ubuntu/ trusty-backports/main amd64 Packages 0.24-0ubuntu7.5 0 500 http://dz.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages 0.24-0ubuntu7.1 0 500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages *** 0.24-0ubuntu5 0 500 http://dz.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages 100 /var/lib/dpkg/status
Force
apt
to installlibcgmanager0
version0.39-2ubuntu2~ubuntu14.04.1
sudo apt-get install libcgmanager0=0.39-2ubuntu2~ubuntu14.04.1
Now we end up in same situation of the user from the mentioned question in the background, wine installation fails with unmet dependency, showing only the first level dependency packages.
apt-get -s install wine
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: wine : Depends: wine1.6 but it is not going to be installed E: Unable to correct problems, you have held broken packages.
apt-get -s install wine1.6
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: wine1.6 : Depends: wine1.6-i386 (= 1:1.6.2-0ubuntu4) E: Unable to correct problems, you have held broken packages.
apt-get -s install wine1.6-i386
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: wine1.6-i386:i386 : Depends: libglu1-mesa:i386 but it is not going to be installed or libglu1:i386 Depends: libgphoto2-6:i386 (>= 2.5.2) but it is not going to be installed Depends: libgphoto2-port10:i386 (>= 2.5.2) but it is not going to be installed Recommends: libsane:i386 but it is not going to be installed E: Unable to correct problems, you have held broken packages.
It is not practical to follow dependencies with apt-get install
one by one.
Ideal Solution:
The real issue here
apt
couldn't installlibcgmanager0:i386
version0.39-2ubuntu2~ubuntu14.04.1
because backports repository have a lower priority100
less then version0.24-0ubuntu7.5
fromupdates
repository with500
apt
couldn't installlibcgmanager0:i386
version0.24-0ubuntu7.5
becauselibcgmanager0:amd64
is installed with a different version0.39-2ubuntu2~ubuntu14.04.1
The quickest fix is, to force installing same i386 version from backports
sudo apt-get install libcgmanager0:i386=0.39-2ubuntu2~ubuntu14.04.1
or downgrade it (amd64) to any version from regular repositories
sudo apt-get install libcgmanager0=0.24-0ubuntu7.5
Ways/tools I have tried:
- Disabling PPA's has no relation to the problem.
- Using
aptitude
in interactive mode, brings only solutions with many removes (>200 !!!). - Use
apt-get install
manually following the dependency tree. Unpractical, as the first & second level dependencies didn't raise meaningful message about the conflict. debfoster
can generate the recursive dependencies but only for already installed package. Howeverwine
is not yet installed.
Topic / My interests:
Let's say I want to install wine without knowing about the problem of libcgmanager0
package (or exactly libcgmanager0:amd64=0.39-2ubuntu2~ubuntu14.04.1
that already installed).
I'm looking for a debug method or a way to know the name of the troubling package and to understand quickly what was going on.
How to debug unmet dependencies problems in general?
May be there some new options in
dpkg
/apt
/aptitude
that trace the internal dependency resolver. That can showlibcgmanager0
in its output.If there is no canonical answer to this, Could anyone show me a better way to generate the recursive dependencies list or simulate the dependency resolver with more details which can help fix the problem?
Why all dependencies? Because I want to check the output of the below commands for all packages at once.
apt-cache policy <all-dependencies>
apt-get -s install <all-dependencies>
Root cause (Update)
After few years here in Ask Ubuntu. I could notice one thing that could help for this case.
apt
,aptitude
&dpkg
don't indicate architecture if it is main the one (amd64
generally), so they always show package-name without the architecture. While they put the architecture suffix on other architecturespackage-name:i368
for example.This creates confusion for new users as it happened to me. I was going with assumption that they are same package. examples:
They actually mean this:
Debug & Troubleshooting commands (Original Answer)
Credits & Thanks go to @muru.
I was looking any command or debug option that can show me the trouble package name (
libcgmanager0
in this test case).apt-get -s -o Debug::pkgProblemResolver=yes install wine
It has a verbose output, quiet hard to understand it. It should be fine, if I get familiar with it.
echo q | aptitude -s install wine
Minimum output but clear notice about the conflict.
Another point I was looking for, is to minimize the output requested from the OP. Instead for requesting
apt-cache policy
for just 1st/2nd level dependencies. I would request it for all recursive dependencies all at once.apt-rdepends wine 2>/dev/null | grep "^[a-zA-Z]" | sort
Be aware that
apt-rdepends
is emulatingapt-cache
so its result may be different than ofdebfoster
. Another point, both tools do not distinguish between arch (i386 or amd64), they just show names.As link above may be removed later, here is the full output of all commands above.