我无法安装任何程序,因为“以下软件包具有未满足的依赖关系”,即使在尝试其他帖子后也是如此

我无法安装任何程序,因为“以下软件包具有未满足的依赖关系”,即使在尝试其他帖子后也是如此

当我尝试安装任何程序时,都会出现此错误。这是最新的例子。

bash pia-linux-2.6.1-05824.run

我明白了

The following packages have unmet dependencies:
 libfreecad-python3-0.18 : Depends: libocct-data-exchange-7.3 but it is not going to be installed
                           Depends: libocct-foundation-7.3 but it is not going to be installed
                           Depends: libocct-modeling-algorithms-7.3 but it is not going to be installed
                           Depends: libocct-modeling-data-7.3 but it is not going to be installed
                           Depends: libocct-ocaf-7.3 but it is not going to be installed
                           Depends: libocct-visualization-7.3 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). 

所以我尝试了推荐

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:
  libboost-python1.58.0 libboost-signals1.58.0 libcoin80v5 libfontconfig1-dev libfreetype6-dev
  libgcrypt20:i386 libocct-data-exchange-7.2 libocct-foundation-7.2 libocct-modeling-algorithms-7.2
  libocct-modeling-data-7.2 libocct-ocaf-7.2 libocct-visualization-7.2 libpng12-dev libpyside1.2
  libqt4-designer libqt4-help libqt4-scripttools libqt4-test libqtassistantclient4 libshiboken1.2v5
  libsoqt4-20 libudev1:i386 python-cycler python-matplotlib python-pivy python-pyside.qtcore
  python-pyside.qtgui python-pyside.qtsvg python-pyside.qtuitools python-pyside.qtxml python-qt4
  python-qt4-gl python-tz
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libocct-data-exchange-7.3 libocct-foundation-7.3 libocct-modeling-algorithms-7.3
  libocct-modeling-data-7.3 libocct-ocaf-7.3 libocct-visualization-7.3
The following NEW packages will be installed:
  libocct-data-exchange-7.3 libocct-foundation-7.3 libocct-modeling-algorithms-7.3
  libocct-modeling-data-7.3 libocct-ocaf-7.3 libocct-visualization-7.3
0 upgraded, 6 newly installed, 0 to remove and 379 not upgraded.
10 not fully installed or removed.
Need to get 18.0 MB of archives.
After this operation, 67.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ppa.launchpad.net/freecad-maintainers/freecad-stable/ubuntu xenial/main amd64 libocct-foundation-7.3 amd64 7.3.0+dfsg1-5~ubuntu16.04.2 [1,237 kB]
Get:2 http://ppa.launchpad.net/freecad-maintainers/freecad-stable/ubuntu xenial/main amd64 libocct-modeling-data-7.3 amd64 7.3.0+dfsg1-5~ubuntu16.04.2 [2,563 kB]
Get:3 http://ppa.launchpad.net/freecad-maintainers/freecad-stable/ubuntu xenial/main amd64 libocct-modeling-algorithms-7.3 amd64 7.3.0+dfsg1-5~ubuntu16.04.2 [7,651 kB]
Get:4 http://ppa.launchpad.net/freecad-maintainers/freecad-stable/ubuntu xenial/main amd64 libocct-visualization-7.3 amd64 7.3.0+dfsg1-5~ubuntu16.04.2 [1,549 kB]
Get:5 http://ppa.launchpad.net/freecad-maintainers/freecad-stable/ubuntu xenial/main amd64 libocct-ocaf-7.3 amd64 7.3.0+dfsg1-5~ubuntu16.04.2 [1,173 kB]
Get:6 http://ppa.launchpad.net/freecad-maintainers/freecad-stable/ubuntu xenial/main amd64 libocct-data-exchange-7.3 amd64 7.3.0+dfsg1-5~ubuntu16.04.2 [3,818 kB]
Fetched 18.0 MB in 13s (1,375 kB/s)                                                                                                              
(Reading database ... 1153886 files and directories currently installed.)
Preparing to unpack .../libocct-foundation-7.3_7.3.0+dfsg1-5~ubuntu16.04.2_amd64.deb ...
Unpacking libocct-foundation-7.3:amd64 (7.3.0+dfsg1-5~ubuntu16.04.2) ...
dpkg: error processing archive /var/cache/apt/archives/libocct-foundation-7.3_7.3.0+dfsg1-5~ubuntu16.04.2_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libTKMath.so.7', which is also in package libocct-foundation-7.2:amd64 7.2.0-0ppa6~ubuntu16.04.1
Preparing to unpack .../libocct-modeling-data-7.3_7.3.0+dfsg1-5~ubuntu16.04.2_amd64.deb ...
Unpacking libocct-modeling-data-7.3:amd64 (7.3.0+dfsg1-5~ubuntu16.04.2) ...
dpkg: error processing archive /var/cache/apt/archives/libocct-modeling-data-7.3_7.3.0+dfsg1-5~ubuntu16.04.2_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libTKGeomBase.so.7', which is also in package libocct-modeling-data-7.2:amd64 7.2.0-0ppa6~ubuntu16.04.1
Preparing to unpack .../libocct-modeling-algorithms-7.3_7.3.0+dfsg1-5~ubuntu16.04.2_amd64.deb ...
Unpacking libocct-modeling-algorithms-7.3:amd64 (7.3.0+dfsg1-5~ubuntu16.04.2) ...
dpkg: error processing archive /var/cache/apt/archives/libocct-modeling-algorithms-7.3_7.3.0+dfsg1-5~ubuntu16.04.2_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libTKMesh.so.7', which is also in package libocct-modeling-algorithms-7.2:amd64 7.2.0-0ppa6~ubuntu16.04.1
Preparing to unpack .../libocct-visualization-7.3_7.3.0+dfsg1-5~ubuntu16.04.2_amd64.deb ...
Unpacking libocct-visualization-7.3:amd64 (7.3.0+dfsg1-5~ubuntu16.04.2) ...
dpkg: error processing archive /var/cache/apt/archives/libocct-visualization-7.3_7.3.0+dfsg1-5~ubuntu16.04.2_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libTKService.so.7', which is also in package libocct-visualization-7.2:amd64 7.2.0-0ppa6~ubuntu16.04.1
No apport report written because MaxReports is reached already
                                                              Preparing to unpack .../libocct-ocaf-7.3_7.3.0+dfsg1-5~ubuntu16.04.2_amd64.deb ...
Unpacking libocct-ocaf-7.3:amd64 (7.3.0+dfsg1-5~ubuntu16.04.2) ...
dpkg: error processing archive /var/cache/apt/archives/libocct-ocaf-7.3_7.3.0+dfsg1-5~ubuntu16.04.2_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libTKCDF.so.7', which is also in package libocct-ocaf-7.2:amd64 7.2.0-0ppa6~ubuntu16.04.1
No apport report written because MaxReports is reached already
                                                              Preparing to unpack .../libocct-data-exchange-7.3_7.3.0+dfsg1-5~ubuntu16.04.2_amd64.deb ...
Unpacking libocct-data-exchange-7.3:amd64 (7.3.0+dfsg1-5~ubuntu16.04.2) ...
dpkg: error processing archive /var/cache/apt/archives/libocct-data-exchange-7.3_7.3.0+dfsg1-5~ubuntu16.04.2_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libTKSTEP209.so.7', which is also in package libocct-data-exchange-7.2:amd64 7.2.0-0ppa6~ubuntu16.04.1
No apport report written because MaxReports is reached already
                                                              Processing triggers for libc-bin (2.23-0ubuntu11) ...
Errors were encountered while processing:
 /var/cache/apt/archives/libocct-foundation-7.3_7.3.0+dfsg1-5~ubuntu16.04.2_amd64.deb
 /var/cache/apt/archives/libocct-modeling-data-7.3_7.3.0+dfsg1-5~ubuntu16.04.2_amd64.deb
 /var/cache/apt/archives/libocct-modeling-algorithms-7.3_7.3.0+dfsg1-5~ubuntu16.04.2_amd64.deb
 /var/cache/apt/archives/libocct-visualization-7.3_7.3.0+dfsg1-5~ubuntu16.04.2_amd64.deb
 /var/cache/apt/archives/libocct-ocaf-7.3_7.3.0+dfsg1-5~ubuntu16.04.2_amd64.deb
 /var/cache/apt/archives/libocct-data-exchange-7.3_7.3.0+dfsg1-5~ubuntu16.04.2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我尝试按照这篇文章中的说明进行操作以下软件包具有未满足的依赖关系!

  1. https://askubuntu.com/a/563319/611345安装依赖项
sudo apt-get update
sudo apt-get install libocct-foundation-7.3
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 libfreecad-python3-0.18 : Depends: libocct-data-exchange-7.3 but it is not going to be installed
                           Depends: libocct-modeling-algorithms-7.3 but it is not going to be installed
                           Depends: libocct-modeling-data-7.3 but it is not going to be installed
                           Depends: libocct-ocaf-7.3 but it is not going to be installed
                           Depends: libocct-visualization-7.3 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
sudo apt-get install -f libocct-foundation-7.3
sudo apt-get install -f libocct-foundation-7.3
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 libfreecad-python3-0.18 : Depends: libocct-data-exchange-7.3 but it is not going to be installed
                           Depends: libocct-modeling-algorithms-7.3 but it is not going to be installed
                           Depends: libocct-modeling-data-7.3 but it is not going to be installed
                           Depends: libocct-ocaf-7.3 but it is not going to be installed
                           Depends: libocct-visualization-7.3 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

  1. https://askubuntu.com/a/1056378/611345安装 aptitude

不适用,因为我使用 bash 安装,而不是 sudo apt-get install packagename

即使确实如此

sudo apt-get -f install aptitude
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 aptitude : Depends: aptitude-common (= 0.7.4-2ubuntu2) but it is not going to be installed
            Depends: libcwidget3v5 but it is not going to be installed
 libfreecad-python3-0.18 : Depends: libocct-data-exchange-7.3 but it is not installable
                           Depends: libocct-foundation-7.3 but it is not installable
                           Depends: libocct-modeling-algorithms-7.3 but it is not installable
                           Depends: libocct-modeling-data-7.3 but it is not installable
                           Depends: libocct-ocaf-7.3 but it is not installable
                           Depends: libocct-visualization-7.3 but it is not installable
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

  1. https://askubuntu.com/a/794360/611345清除原始程序
apt list --installed

返回一些相关的包

freecad/
freecad-common/
freecad-python3/
freecad-runtime/
sudo apt-get --purge remove freecad
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 libfreecad-python3-0.18 : Depends: libocct-data-exchange-7.3 but it is not going to be installed
                           Depends: libocct-foundation-7.3 but it is not going to be installed
                           Depends: libocct-modeling-algorithms-7.3 but it is not going to be installed
                           Depends: libocct-modeling-data-7.3 but it is not going to be installed
                           Depends: libocct-ocaf-7.3 but it is not going to be installed
                           Depends: libocct-visualization-7.3 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
  1. https://askubuntu.com/a/563537/611345

不适用,因为我不再关心 freecad,我正在尝试安装一些完全不相关的东西,无论我尝试安装什么,都会发生这种情况

  1. https://askubuntu.com/a/563291/611345

不适用,因为它特定于 postgresql

  1. 添加 PPA 后如何解决未满足的依赖关系?

我尝试删除 freecad ppa 并尝试再次安装该程序,但出现同样的错误

答案1

有人指出我犯了“试图覆盖”错误,因此我做了更多研究,并按照另一个答案中的建议进行操作https://askubuntu.com/a/433510/611345我通过清除冲突的包解决了该问题。

它总是抱怨的事情是,libfreecad-python3-0.18所以我先尝试清除它

$ sudo dpkg -P libfreecad-python3-0.18
dpkg: dependency problems prevent removal of libfreecad-python3-0.18:
 freecad-python3 depends on libfreecad-python3-0.18 (<< 2:0.18.4+dfsg1~201911102059~ubuntu16.04.1+1~).
 freecad-python3 depends on libfreecad-python3-0.18 (>= 2:0.18.4+dfsg1~201911102059~ubuntu16.04.1).
 freecad-python3 depends on libfreecad-python3-0.18 (<< 2:0.18.4+dfsg1~201911102059~ubuntu16.04.1+1~).
 freecad-python3 depends on libfreecad-python3-0.18 (>= 2:0.18.4+dfsg1~201911102059~ubuntu16.04.1).

dpkg: error processing package libfreecad-python3-0.18 (--purge):
 dependency problems - not removing
Errors were encountered while processing:
 libfreecad-python3-0.18

但它说它不能做到这一点,因为freecad-python3取决于它,所以我尝试删除它

$ sudo dpkg -P freecad-python3
dpkg: dependency problems prevent removal of freecad-python3:
 freecad depends on freecad-python3 | freecad-python2; however:
  Package freecad-python3 is to be removed.
  Package freecad-python2 is not installed.

dpkg: error processing package freecad-python3 (--purge):
 dependency problems - not removing
Errors were encountered while processing:
 freecad-python3

但后来它说freecad取决于这一点,所以我尝试删除它

$ sudo dpkg -P freecad
(Reading database ... 1153885 files and directories currently installed.)
Removing freecad (2:0.18.4+dfsg1~201911102059~ubuntu16.04.1) ...
Processing triggers for shared-mime-info (1.5-2ubuntu0.2) ...

它奏效了,所以我freecad-python3又试了一次

$ sudo dpkg -P freecad-python3
(Reading database ... 1153879 files and directories currently installed.)
Removing freecad-python3 (2:0.18.4+dfsg1~201911102059~ubuntu16.04.1) ...

然后libfreecad-python3-0.18

$ sudo dpkg -P libfreecad-python3-0.18
(Reading database ... 1153872 files and directories currently installed.)
Removing libfreecad-python3-0.18 (2:0.18.4+dfsg1~201911102059~ubuntu16.04.1) ...
Processing triggers for libc-bin (2.23-0ubuntu11) ...

此后我可以安装其他程序。

相关内容