依赖项“不会安装”...但它们已经安装了

依赖项“不会安装”...但它们已经安装了

libapache2-mod-php5尝试在 xenial 上安装时出现此错误:

The following packages have unmet dependencies:
 fontconfig : PreDepends: dpkg (>= 1.16.1)
              Depends: fontconfig-config but it is not going to be installed
 libapache2-mod-php5 : Depends: libssl1.0.0 (>= 1.0.0) but it is not going to be installed
                       Depends: apache2-mpm-prefork (> 2.0.52) but it is not going to be installed or
                                apache2-mpm-itk but it is not installable
                       Depends: apache2.2-common but it is not going to be installed
                       Depends: php5-common (= 5.3.10-1ubuntu3.25) but it is not going to be installed
                       Depends: ucf but it is not going to be installed
                       Depends: tzdata but it is not going to be installed
                       Recommends: php5-cli but it is not going to be installed
 libfontconfig1 : Depends: fontconfig-config (= 2.11.94-0ubuntu1.1) but it is not going to be installed
 libgtk2.0-0 : Depends: libcairo2 (>= 1.6.4-6.1) but it is not going to be installed
               Depends: libpangocairo-1.0-0 (>= 1.28.3) but it is not going to be installed
               Depends: libpangoft2-1.0-0 (>= 1.28.3) but it is not going to be installed
               Recommends: libgtk2.0-bin
 libqt5svg5 : PreDepends: dpkg (>= 1.15.6~)
              Depends: libqt5widgets5 (>= 5.3.0) but it is not going to be installed
 libuuid1 : Depends: passwd
            Recommends: uuid-runtime

类似问题的答案建议尝试手动安装软件包。但是fontconfig,,,,和已经安装。所以所有名为依赖项的软件包都是如此libfontconfig1。那么为什么它无法安装?libgtk2.0-0libqt5svg5libuuid1libapache2-mod-php5

编辑:php7.0我通过安装解决了这个问题libapache2-mod-php7.0,但我仍然想了解这些令人困惑的错误消息。

按照要求:

$ sudo apt-cache policy libapache2-mod-php5
libapache2-mod-php5:
  Installed: (none)
  Candidate: 5.3.10-1ubuntu3.25
  Version table:
     5.3.10-1ubuntu3.25 500
        500 http://us.archive.ubuntu.com/ubuntu precise-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu precise-security/main amd64 Packages
     5.3.10-1ubuntu3 500
        500 http://us.archive.ubuntu.com/ubuntu precise/main amd64 Packages

嗯……

$ grep precise /etc/apt/sources.list

(无输出)

我使用 GIMP 2.6,因为 2.8 太垃圾了。我忘了具体是怎么安装 2.6 的,但我觉得它类似于这个答案。这是否意味着尽管我从中删除了存储库,但其缓存中apt仍然有内容?precisesources.list

答案1

您正在尝试安装不受支持且不存在的软件包,因为 Xenial 默认php版本是php7.0(没有任何php5.x分支的包)并且相同阿帕奇2使用默认版本2.4.18(以及其他版本)不能满足您所需的软件包依赖关系。

奇怪的是,您如何将输出发送到终端, apt install libapache2-mod-php5(或apt show)通知根本没有候选(不存在)。似乎您在系统/缓存中有任何 Precise repo 或任何包,这会产生冲突。

尝试清理它并尝试按照以下步骤重新安装它:

  • 从中删除任何现有的存储库精确 (12.04)使用终端或 GUI。
  • 使用以下命令全面更新您的系统并清除旧软件包:sudo apt update && sudo apt full-upgrade
  • 清理系统中未使用/旧的软件包和文件:sudo apt autoclean && sudo apt autoremove
  • 使用 清空 apt 缓存sudo apt clean
  • 使用以下命令安装 mod php 包sudo apt install libapache2-mod-php(将安装libapache2-mod-php7默认的 xenial 版本)

希望能帮助到你。

相关内容