The most used close target for apt/dpkg questions is thisthis. However, that does not help if the problem is not with apt
but with the underlying dpkg
.
I very often find things like theselike these when I check the apt and dpkg tags and that really bugs me. How can an APT question solve a DPKG problem? Unfortunately, people who misunderstand the underlying issue are misinforming users about how to solve their problems and mistakenly flagging those questions as duplicates. This, in turn, makes people ask more questions, because their problem hasn't been solved. This has to stop.
I've written extensive guides about what information a question should have to provide the relevant answer/duplicate for most of the common problems of apt and dpkg. Here and elsewhere. Yet the situation in Ask Ubuntu doesn't improve.
For now, I decided to re-title the infamous "How do I resolve unmet dependencies?" question to "How do I resolve unmet dependencies after adding a PPA?" following what the answers and users believe will help to solve OP's problem (btw, the whole question is a massive Catch-22, since you can't install the desired package because dependency issues which can be solved by removing the PPA, but can't remove the PPA because the package you want to install is provided by that PPA).
So, please, whenever you see:
The following packages have unmet dependencies:
apache2:
Depends: apache2.2-common (= 2.2.22-1ubuntu1) but 2.2.22-1ubuntu1.2 is to be installed
E: Unable to correct problems, you have held broken packages.
Ask for the output of apt-cache policy all-the-package-listed
and sudo apt-get check
. If you see:
E: Sub-process /usr/bin/dpkg returned an error code (1)
Ask for the the same as above, the complete output of whatever OP is trying to do and sudo dpkg -C
.
This way we will make sure that OP solve his problem along with achieving whatever he's trying to do. If that information isn't provided, flag it as "Unclear what you are asking". That way, you do the site a favor, and we provide precise solution to precise problems.