TL;DR - 我的系统不想安装 libpng12,但许多应用程序依赖于该库。操作系统 - Kali 滚动
嘿伙计们。在过去的几天里,我试图解决使用 apt 安装 python3-opencv 时遇到的这个问题。我得到的错误:
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libqtgui4 : Depends: libpng12-0 (>= 1.2.13-4) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
当我尝试按照建议运行时apt --fix-broken install
:
The following additional packages will be installed:
libpng12-0
The following NEW packages will be installed:
libpng12-0
0 upgraded, 1 newly installed, 0 to remove and 2294 not upgraded.
2 not fully installed or removed.
Need to get 0 B/173 kB of archives.
After this operation, 273 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 602063 files and directories currently installed.)
Preparing to unpack .../libpng12-0_1.2.50-2+deb8u3_amd64.deb ...
Unpacking libpng12-0:amd64 (1.2.50-2+deb8u3) ...
dpkg: error processing archive /var/cache/apt/archives/libpng12-0_1.2.50-2+deb8u3_amd64.deb (-
-unpack):
unable to install new version of '/usr/lib/x86_64-linux-gnu/libpng12.so.0': No such file or d
irectory
Errors were encountered while processing:
/var/cache/apt/archives/libpng12-0_1.2.50-2+deb8u3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
由于这不起作用,我尝试使用以下命令从 deb 包安装dpkg -i libpng12-0_1.2.54-1ubuntu1.1_amd64.deb
:
(Reading database ... 602063 files and directories currently installed.)
Preparing to unpack libpng12-0_1.2.54-1ubuntu1.1_amd64.deb ...
Unpacking libpng12-0:amd64 (1.2.54-1ubuntu1.1) ...
dpkg: error processing archive libpng12-0_1.2.54-1ubuntu1.1_amd64.deb (--install):
unable to install new version of '/lib/x86_64-linux-gnu/libpng12.so.0': No such file or directory
Processing triggers for libc-bin (2.30-8) ...
Errors were encountered while processing:
libpng12-0_1.2.54-1ubuntu1.1_amd64.deb
这就是我放弃的地方,并决定问你们所有人:D 我还能做些什么来获得这个库?
答案1
libpng
(提供libpng12-0
)自 2016 年 4 月 24 日起已从 Kali Linux 中删除。
可以python3-opencv
通过以下方式安装apt
:
sudo apt install opencv
opencv
包提供python3-opencv
。
您的 中应该有以下行/etc/apt/sources.list
:
deb http://http.kali.org/kali kali-rolling main non-free contrib