-1

I get this error when trying to install libapache2-mod-php5 on 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

The answers to similar questions suggest trying to install the packages manually. But fontconfig, libfontconfig1, libgtk2.0-0, libqt5svg5, and libuuid1 are already installed. So are all the packages named as dependencies of libapache2-mod-php5. So why won't it install?

Edit: I solved the problem by installing php7.0 and libapache2-mod-php7.0 instead, but I'd still like to understand these confusing error messages.

As requested:

$ 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

Hmmm...

$ grep precise /etc/apt/sources.list

(no output)

I'm using GIMP 2.6 because 2.8 is heinous garbage. I forget exactly how I installed 2.6, but I think it was similar to this answer. Does this suggest that apt still has precise stuff in its cache, even though I removed the repos from sources.list?

MicrosoftFree
  • 161
  • 1
  • 8
  • 1
    Please edit your question to add the output of apt-cache policy libapache2-mod-php5. – fkraiem Dec 24 '16 at 22:04
  • @fkraiem Done, and added a possible clue. – MicrosoftFree Dec 26 '16 at 00:05
  • 1
    If you have a package from Precise installed, then you sould keep the Precise repositories in order to get bugfix and security updates, and use Apt pinning as described in the linked answer to ensure they are used only for the packages you want. – fkraiem Dec 26 '16 at 00:39
  • 2
    And as for why you still get Precise packages after seemingly having removed the repositories, either you have not run sudo apt update, or the repositories are in /etc/apt/sources.list.d. – fkraiem Dec 26 '16 at 00:41

1 Answers1

1

You are trying to install an unsupported and inexistent package, since Xenial default php version is php7.0 (there are no packackes from any php5.x branch) and same for apache2 with default version 2.4.18 (among others) what doesn't meet your desired package dependecies.

The strange thing is how you get that output to the terminal, apt install libapache2-mod-php5 (or apt show) informs there is no candidates (doesn exist) at all. Seems that you have any Precise repo or any package into system/cache which is generating conflicts.

Try to clean it and try to reinstall it according to the following:

  • Remove any existent repository from Precise (12.04) using terminal or gui.
  • Full update you system while purging old packages with: sudo apt update && sudo apt full-upgrade.
  • Clean the system for unused/old packages and files issuing: sudo apt autoclean && sudo apt autoremove.
  • Empty apt cache with sudo apt clean.
  • Install the mod php package with sudo apt install libapache2-mod-php (which will install libapache2-mod-php7, the default xenial version)

Hope it helps.

dgonzalez
  • 7,010
  • 6
  • 19
  • 28