Turnkey LAMP não pode instalar a biblioteca PHP GD

1

Quando tento instalar a biblioteca GD para PHP no meu dispositivo TurnKey LAMP, recebo a seguinte mensagem:

root@lamp ~# apt-get install php5-gd
Reading package lists... Done
Building dependency tree
Reading state information... Done
php5-gd is already the newest version.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 php5-gd : Depends: libgd2-xpm (>= 2.0.36~rc1~dfsg) but it is not going to be installed
           Depends: libjpeg8 (>= 8c) but it is not going to be installed
           Depends: libpng12-0 (>= 1.2.13-4) but it is not going to be installed
           Depends: libx11-6 but it is not going to be installed
           Depends: libxpm4 but it is not going to be installed
           Depends: phpapi-20100525+lfs but it is not installable
           Depends: php5-common (= 5.4.4-14) but 5.3.3-7+squeeze14 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Então, quando eu tento usar a opção 'apt-get -f install', eu entendo isso:

root@lamp ~# apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  fontconfig-config libfontconfig1 libgd2-xpm libjpeg62 libpng12-0 libx11-6
  libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 ttf-dejavu-core
Suggested packages:
  libgd-tools
The following packages will be REMOVED:
  php5-gd
The following NEW packages will be installed:
  fontconfig-config libfontconfig1 libgd2-xpm libjpeg62 libpng12-0 libx11-6
  libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 ttf-dejavu-core
0 upgraded, 12 newly installed, 1 to remove and 33 not upgraded.
Need to get 0 B/3557 kB of archives.
After this operation, 8569 kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
[master e6f9b93] saving uncommitted changes in /etc prior to apt run
 Author: root <root@lamp>
 1 files changed, 1 insertions(+), 1 deletions(-)
 rewrite webmin/system-status/info (100%)
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 25484 files and directories currently installed.)
Removing php5-gd ...
/var/lib/dpkg/info/php5-gd.prerm: 11: php5dismod: not found
dpkg: error processing php5-gd (--remove):
 subprocess installed pre-removal script returned error exit status 127
configured to not write apport reports
                                      Processing triggers for libapache2-mod-php5 ...
Reloading web server config: apache2apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
.
Errors were encountered while processing:
 php5-gd
Counting objects: 1469, done.
Compressing objects: 100% (957/957), done.
Writing objects: 100% (1469/1469), done.
Total 1469 (delta 123), reused 1460 (delta 119)
E: Sub-process /usr/bin/dpkg returned an error code (1)

Alguma ideia? Obrigado.

    
por trip0d199 09.03.2013 / 14:52

1 resposta

0

Parece que seu sistema baseado no Debian está faltando alguns arquivos que foram instalados com pacotes de terceiros de repositórios de terceiros, e muitas coisas estão fora de sincronia.

Seu problema imediato é:

/var/lib/dpkg/info/php5-gd.prerm: 11: php5dismod: not found

Você pode contornar isso ao editando o arquivo /var/lib/dpkg/info/php5-gd.prerm , removendo todo o seu conteúdo e substituindo-o por:

#!/bin/sh
set -e

Neste ponto, execute apt-get install -f novamente.

Depois que isso for concluído com sucesso, para que seu sistema volte a ser sincronizado, execute:

apt-get update && apt-get dist-upgrade

Uma vez completada com sucesso, você pode reinstalar o pacote php5-gd.

apt-get install php5-gd

No futuro, tenha cuidado ao remover manualmente os arquivos incluídos nos pacotes do sistema, tenha cuidado com os repositórios de terceiros que você usa e tenha cuidado especial ao combinar pacotes de diferentes versões do Debian (por exemplo, stable e testing).

    
por 09.03.2013 / 15:00