0

I've got stucked for 4 days on installing openCV.always got error while compile the source code. I assume because libtiff5-dev not installed on my machine, then I tiedy to install libtiff5-dev, here is the 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:
 libtiff5-dev : Depends: liblzma-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

said "depends liblzma-dev", then I tried to

$ sudo apt-get install liblzma-dev

but error too, here is the 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:
 liblzma-dev : Depends: liblzma5 (= 5.1.1alpha+20120614-2ubuntu2) but 5.2.2-1.3~16.04.york0 is to be installed
E: Unable to correct problems, you have held broken packages.

anyone have solution for this problem ?

  • 2
    Does this answer your question? [Unable to correct problems, you have held broken packages](https://askubuntu.com/questions/223237/unable-to-correct-problems-you-have-held-broken-packages) – karel Sep 17 '20 at 14:52
  • 1
    You have version mismatches either because you have some PPA or it's been a while since you ran `apt update`. What is the output of `apt-cache policy liblzma-dev`? – Kulfy Sep 17 '20 at 15:30
  • @Kulfy, here is the output of apt-cache policy liblzma-dev : `liblzma-dev: Candidate: 5.1.1alpha+20120614-2ubuntu2 Version table: 5.1.1alpha+20120614-2ubuntu2 500 500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages` – Roby Firnando Yusuf Sep 17 '20 at 15:30
  • And what about `apt-cache policy liblzma5`? – Kulfy Sep 17 '20 at 16:03
  • @Kulfy, here it is : `liblzma5: Installed: 5.2.2-1.3~16.04.york0 Candidate: 5.2.2-1.3~16.04.york0 Version table: *** 5.2.2-1.3~16.04.york0 100 100 /var/lib/dpkg/status 5.1.1alpha+20120614-2ubuntu2 500 500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages` – Roby Firnando Yusuf Sep 17 '20 at 16:05
  • Was there any PPA before? What do you get if you run `sudo apt install liblzma5=5.1.1alpha+20120614-2ubuntu2`? – Kulfy Sep 18 '20 at 14:19

1 Answers1

0

Just had the same issue in Ubuntu 20.04.3 with a newer version of that package.

The following packages have unmet dependencies:
   liblzma-dev : Depends: liblzma5 (= 5.2.4-1) but 5.2.4-1ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.

Fixed it by downgrading the required dependency and installing the version it's asking for.

apt install liblzma5=5.2.4-1
varno
  • 1
  • 2