AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1312138
Accepted
Mona Jalal
Mona Jalal
Asked: 2021-01-30 19:46:43 +0800 CST2021-01-30 19:46:43 +0800 CST 2021-01-30 19:46:43 +0800 CST

E:未满足的依赖关系。尝试不带软件包的“apt --fix-broken install”(或指定解决方案)。Ubuntu 20.04 上缺少 libpng12-0

  • 772

我正在尝试升级 apt,但出现以下错误。我应该如何解决它?

mona@goku:~$ sudo apt update
Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu focal InRelease                                                              
Hit:3 https://download.docker.com/linux/ubuntu focal InRelease                                                         
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease                                                       
Hit:5 http://ppa.launchpad.net/nm-l2tp/network-manager-l2tp/ubuntu focal InRelease                                     
Hit:6 http://deb.anydesk.com all InRelease                                                                             
Hit:7 https://packages.microsoft.com/repos/ms-teams stable InRelease                                                   
Hit:8 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease                                                      
Hit:9 http://archive.ubuntu.com/ubuntu xenial InRelease                                                                
Hit:10 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease                                                 
Hit:11 http://lenovo.archive.canonical.com focal InRelease                                     
Hit:12 http://ppa.launchpad.net/zeehio/libxp/ubuntu focal InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
119 packages can be upgraded. Run 'apt list --upgradable' to see them.
mona@goku:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libopencv-highgui2.4v5 : Depends: libpng12-0 (>= 1.2.13-4) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
mona@goku:~$ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libopencv-highgui2.4v5 : Depends: libpng12-0 (>= 1.2.13-4) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
mona@goku:~$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  cpp-7 libpython-dev libpython2.7-dev libpython3-dev python2.7-dev python3-decorator python3-ipython-genutils
  python3-jupyter-core python3-traitlets python3.8-dev
Use 'sudo apt autoremove' to remove them.
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 119 not upgraded.
5 not fully installed or removed.
Need to get 0 B/116 kB of archives.
After this operation, 285 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 408627 files and directories currently installed.)
Preparing to unpack .../libpng12-0_1.2.54-1ubuntu1_amd64.deb ...
Unpacking libpng12-0:amd64 (1.2.54-1ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/libpng12-0_1.2.54-1ubuntu1_amd64.deb (--unpack):
 unable to install new version of '/lib/x86_64-linux-gnu/libpng12.so.0': No such file or directory
No apport report written because the error message indicates an issue on the local system
                                                                                         Errors were encountered while p
rocessing:
 /var/cache/apt/archives/libpng12-0_1.2.54-1ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

和

mona@goku:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  cpp-7 libpython-dev libpython2.7-dev libpython3-dev python2.7-dev python3-decorator python3-ipython-genutils
  python3-jupyter-core python3-traitlets python3.8-dev
Use 'sudo apt autoremove' to remove them.
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 119 not upgraded.
5 not fully installed or removed.
Need to get 0 B/116 kB of archives.
After this operation, 285 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 408627 files and directories currently installed.)
Preparing to unpack .../libpng12-0_1.2.54-1ubuntu1_amd64.deb ...
Unpacking libpng12-0:amd64 (1.2.54-1ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/libpng12-0_1.2.54-1ubuntu1_amd64.deb (--unpack):
 unable to install new version of '/lib/x86_64-linux-gnu/libpng12.so.0': No such file or directory
No apport report written because the error message indicates an issue on the local system
                                                                                         Errors were encountered while processing:
 /var/cache/apt/archives/libpng12-0_1.2.54-1ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

和

mona@goku:~$ sudo dpkg --configure -a 
dpkg: dependency problems prevent configuration of libopencv-highgui2.4v5:amd64:
 libopencv-highgui2.4v5:amd64 depends on libpng12-0 (>= 1.2.13-4); however:
  Package libpng12-0:amd64 is not installed.

dpkg: error processing package libopencv-highgui2.4v5:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libopencv-objdetect2.4v5:amd64:
 libopencv-objdetect2.4v5:amd64 depends on libopencv-highgui2.4v5 (= 2.4.9.1+dfsg-1.5ubuntu1); however:
  Package libopencv-highgui2.4v5:amd64 is not configured yet.

dpkg: error processing package libopencv-objdetect2.4v5:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libopencv-contrib2.4v5:amd64:
 libopencv-contrib2.4v5:amd64 depends on libopencv-highgui2.4v5 (= 2.4.9.1+dfsg-1.5ubuntu1); however:
  Package libopencv-highgui2.4v5:amd64 is not configured yet.
 libopencv-contrib2.4v5:amd64 depends on libopencv-objdetect2.4v5 (= 2.4.9.1+dfsg-1.5ubuntu1); however:
  Package libopencv-objdetect2.4v5:amd64 is not configured yet.

dpkg: error processing package libopencv-contrib2.4v5:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libopencv-legacy2.4v5:amd64:
 libopencv-legacy2.4v5:amd64 depends on libopencv-highgui2.4v5 (= 2.4.9.1+dfsg-1.5ubuntu1); however:
  Package libopencv-highgui2.4v5:amd64 is not configured yet.

dpkg: error processing package libopencv-legacy2.4v5:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-opencv:
 python-opencv depends on libopencv-contrib2.4v5; however:
  Package libopencv-contrib2.4v5:amd64 is not configured yet.
 python-opencv depends on libopencv-highgui2.4v5; however:
  Package libopencv-highgui2.4v5:amd64 is not configured yet.
 python-opencv depends on libopencv-legacy2.4v5; however:
  Package libopencv-legacy2.4v5:amd64 is not configured yet.
 python-opencv depends on libopencv-objdetect2.4v5; however:
  Package libopencv-objdetect2.4v5:amd64 is not configured yet.

dpkg: error processing package python-opencv (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.31-0ubuntu9.1) ...
Errors were encountered while processing:
 libopencv-highgui2.4v5:amd64
 libopencv-objdetect2.4v5:amd64
 libopencv-contrib2.4v5:amd64
 libopencv-legacy2.4v5:amd64
 python-opencv

和

mona@goku:~$ sudo apt autoremove
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libopencv-highgui2.4v5 : Depends: libpng12-0 (>= 1.2.13-4) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

和:

mona@goku:~$ namei -l /lib/x86_64-linux-gnu/libpng12.so.0
f: /lib/x86_64-linux-gnu/libpng12.so.0
drwxr-xr-x root root /
lrwxrwxrwx root root lib -> usr/lib
drwxr-xr-x root root   usr
drwxr-xr-x root root   lib
drwxr-xr-x root root x86_64-linux-gnu
                     libpng12.so.0 - No such file or directory

和

mona@goku:~$ sudo apt purge libopencv-highgui2.4v5 libpng12-0
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'libpng12-0' is not installed, so not removed
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libopencv-contrib2.4v5 : Depends: libopencv-highgui2.4v5 (= 2.4.9.1+dfsg-1.5ubuntu1) but it is not going to be installed
 libopencv-legacy2.4v5 : Depends: libopencv-highgui2.4v5 (= 2.4.9.1+dfsg-1.5ubuntu1) but it is not going to be installed
 libopencv-objdetect2.4v5 : Depends: libopencv-highgui2.4v5 (= 2.4.9.1+dfsg-1.5ubuntu1) but it is not going to be installed
 python-opencv : Depends: libopencv-highgui2.4v5 but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
apt
  • 1 1 个回答
  • 2480 Views

1 个回答

  • Voted
  1. Best Answer
    Mona Jalal
    2021-01-30T20:03:21+08:002021-01-30T20:03:21+08:00

    sarnoldUbuntu IRC 频道的解决方案:

    $ sudo apt purge libopencv-highgui2.4v5 libpng12-0 libopencv-contrib2.4v5 libopencv-legacy2.4v5 libopencv-objdetect2.4v5 python-opencv
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Package 'libpng12-0' is not installed, so not removed
    The following packages were automatically installed and are no longer required:
      cpp-7 libavcodec-ffmpeg56 libavformat-ffmpeg56 libavutil-ffmpeg54 libbluray1 libcrystalhd3 libilmbase12 libjasper1
      libopencv-calib3d2.4v5 libopencv-core2.4v5 libopencv-features2d2.4v5 libopencv-flann2.4v5 libopencv-imgproc2.4v5
      libopencv-ml2.4v5 libopencv-photo2.4v5 libopencv-video2.4v5 libopenexr22 libopenjpeg5 libpython-dev libpython2.7
      libpython2.7-dev libpython3-dev libschroedinger-1.0-0 libswresample-ffmpeg1 libswscale-ffmpeg3 libva1 libvpx3
      libwebp5 libx264-148 libx265-79 python2.7-dev python3-decorator python3-ipython-genutils python3-jupyter-core
      python3-traitlets python3.8-dev
    Use 'sudo apt autoremove' to remove them.
    The following packages will be REMOVED:
      libopencv-contrib2.4v5* libopencv-highgui2.4v5* libopencv-legacy2.4v5* libopencv-objdetect2.4v5* python-opencv*
    0 upgraded, 0 newly installed, 5 to remove and 119 not upgraded.
    5 not fully installed or removed.
    After this operation, 4,305 kB disk space will be freed.
    Do you want to continue? [Y/n] y
    (Reading database ... 408627 files and directories currently installed.)
    Removing python-opencv (2.4.9.1+dfsg-1.5ubuntu1) ...
    Removing libopencv-contrib2.4v5:amd64 (2.4.9.1+dfsg-1.5ubuntu1) ...
    Removing libopencv-objdetect2.4v5:amd64 (2.4.9.1+dfsg-1.5ubuntu1) ...
    Removing libopencv-legacy2.4v5:amd64 (2.4.9.1+dfsg-1.5ubuntu1) ...
    Removing libopencv-highgui2.4v5:amd64 (2.4.9.1+dfsg-1.5ubuntu1) ...
    Processing triggers for libc-bin (2.31-0ubuntu9.1) ...
    
    • 4

相关问题

  • 如何编写 shell 脚本来安装应用程序列表?

  • 如何查看存档中可用的软件包的所有版本?

  • 是否可以说出我安装的哪些软件包不在原版安装中?

  • 如何删除 PPA?

  • 使用 apt-get upgrade 时如何强制安装内核更新?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve