2

I am trying to install ffmpeg in Ubuntu 16.04 and it has a dependency package zlib1g-dev. when running sudo apt-get install zlib1g-dev. I am getting the below error

The following packages have unmet dependencies:
 zlib1g-dev : Depends: zlib1g (= 1:1.2.8.dfsg-2ubuntu4) but 1:1.2.8.dfsg-2ubuntu4.1 is to be installed
E: Unable to correct problems, you have held broken packages.

I read somewhere it might be due to a issue in sources.list. I've checked sources.list file it seems to be fine and verified with this link ( https://gist.github.com/rohitrawat/60a04e6ebe4a9ec1203eac3a11d4afc1 ) and sudo apt-get update doesn't shows any error as well. Can you please suggest. Thanks!!!

EDIT 1: I've also followed solution on this link ( E: Unable to correct problems, you have held broken packages ) and executed sudo apt-mark showhold but it didn't print anything. So couldn't unmark anything also tried the solution with aptitude and the log by running sudo aptitude install zlib1g-dev was:

The following NEW packages will be installed: zlib1g-dev{b} 0 packages upgraded, 1 newly installed, 0 to remove and 17 not upgraded. Need to get 168 kB of archives. After unpacking 426 kB will be used. The following packages have unmet dependencies: zlib1g-dev : Depends: zlib1g (= 1:1.2.8.dfsg-2ubuntu4) but 1:1.2.8.dfsg-2ubuntu4.1 is installed. The following actions will resolve these dependencies:

 Keep the following packages at their current version:

1) zlib1g-dev [Not Installed]

Accept this solution? [Y/n/q/?] y No packages will be installed, upgraded, or removed. 0 packages upgraded, 0 newly installed, 0 to remove and 17 not upgraded. Need to get 0 B of archives. After unpacking 0 B will be used.

| improve this question | | | | |
  • I tried after installing aptitude it suggested the solution but nothing happened and also tried apt-mark showhold but nothing happened. Still at square one – Anmol Kohli Feb 1 '18 at 21:06
0

Answer for this is given by SeinopSys in Error installing zlib1g-dev you need to take note of the required package version (in your case = 1:1.2.8.dfsg-2ubuntu4), then run the command below to downgrade to that version:

$ sudo apt install zlib1g=1:1.2.8.dfsg-2ubuntu4

Then you can try re-installing.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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