安装 libtiff5-dev 时出错

安装 libtiff5-dev 时出错

我在安装 openCV 时卡了 4 天,编译源代码时总是出错。我猜是因为我的机器上没有安装 libtiff5-dev,所以我决定安装 libtiff5-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:
 libtiff5-dev : Depends: liblzma-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

说“依赖 liblzma-dev”,然后我尝试

$ sudo apt-get 安装 liblzma-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:
 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.

有人能解决这个问题吗?

答案1

在使用该软件包的较新版本的 Ubuntu 20.04.3 中刚刚遇到了同样的问题。

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.

通过降级所需的依赖项并安装其要求的版本来修复该问题。

apt install liblzma5=5.2.4-1

相关内容