Monday, March 14, 2022

[SOLVED] APT Error: Depends: perl (= 5.14.2-6ubuntu2) but 5.14.2-6ubuntu2.1 is to be installed

Issue

I just try install libperl-dev with apt on Ubuntu, but I have following error:

user@comp-2:~$ sudo apt-get install libperl-dev
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:
 libperl-dev : Depends: perl (= 5.14.2-6ubuntu2) but 5.14.2-6ubuntu2.1 is to be installed
               Depends: libperl5.14 (= 5.14.2-6ubuntu2) but 5.14.2-6ubuntu2.1 is to be installed
E: Unable to correct problems, you have held broken packages.

I tried to google the problem but didn't found something clear.
Can some one explain me what it's mean: "Depends: libperl5.14 (= 5.14.2-6ubuntu2) but 5.14.2-6ubuntu2.1 is to be installed", and how to solve it?
Thank you for ahead.


Solution

Basically the error message tells you all three packages (libperl-dev, perl and libperl5.14) need to have exactly the same version (either 5.14.2-6ubuntu2 or 5.14.2-6ubuntu2.1), but you are trying to mix the two. I can't tell you why is that (maybe you are trying to mix packages from different distributions, something like debian testing/unstable), but if you used aptitude, you could examine the situation in an interactive dependency solver (maybe it would even find an acceptable solution for you automatically).

So, use aptitude and examine the versions of the packages, both those you are trying to install and those you already have.



Answered By - jpalecek
Answer Checked By - Pedro (WPSolving Volunteer)