Ubuntu confiável instalar php gd

0

Estou instalando o componente php gd5, mas recebendo alguns erros incomuns, que eu não entendo. Funcionou bem no meu servidor local, mas no VPS estou enfrentando esse problema.

Aqui está o comando:
apt-get install php5-gd

e o erro:

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:
php5-gd : Depends: libgd3 (>= 2.1.0~alpha~) but it is not going to be installed
Depends: phpapi-20121212
Depends: php5-common (= 5.5.9+dfsg-1ubuntu4.14) but 5.6.14+dfsg-1+deb.sury.org~precise+1 is to be installed
php5-imagick : Depends: libmagickcore4 (>= 8:6.6.9.7) but it is not installable
Depends: libmagickwand4 (>= 8:6.6.9.7) but it is not installable
Depends: phpapi-20100525 but it is not installable
Recommends: ghostscript
Recommends: ttf-dejavu-core but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Em try com o apt-get -f, aqui está o que eu recebo:

apt-get -f instala o php5-gd

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:
 php5-gd : Depends: libgd3 (>= 2.1.0~alpha~) but it is not going to be installed
           Depends: phpapi-20121212
           Depends: php5-common (= 5.5.9+dfsg-1ubuntu4.14) but 5.6.14+dfsg-1+deb.sury.org~precise+1 is to be installed
 php5-imagick : Depends: libmagickcore4 (>= 8:6.6.9.7) but it is not installable
                Depends: libmagickwand4 (>= 8:6.6.9.7) but it is not installable
                Depends: phpapi-20100525 but it is not installable
                Recommends: ghostscript
                Recommends: ttf-dejavu-core but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Em Execução do apt-get -f install (sem pacote)

apt-get -f install

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages will be REMOVED:
  php5-imagick
0 upgraded, 0 newly installed, 1 to remove and 111 not upgraded.
1 not fully installed or removed.
After this operation, 476 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 73412 files and directories currently installed.)
Removing php5-imagick (3.1.0~rc2-1~precise+1) ...
sed: can't read /etc/php5/conf.d/imagick.ini: No such file or directory
dpkg: error processing package php5-imagick (--remove):
 subprocess installed post-removal script returned error exit status 2
Errors were encountered while processing:
 php5-imagick
E: Sub-process /usr/bin/dpkg returned an error code (1)

Alguém tem uma ideia de como consertar isso?

Depois de tentar mais algumas coisas:

root@vps:~# mkdir /etc/php5/conf.d/
root@vps:~# touch /etc/php5/conf.d/imagick.ini
root@vps:~# apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  php5-imagick
0 upgraded, 0 newly installed, 1 to remove and 111 not upgraded.
1 not fully installed or removed.
After this operation, 476 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 73398 files and directories currently installed.)
Removing php5-imagick (3.1.0~rc2-1~precise+1) ...
root@vps:~# apt-get install php5-gd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php5-gd : Depends: phpapi-20121212
           Depends: php5-common (= 5.5.9+dfsg-1ubuntu4.14) but 5.6.14+dfsg-1+deb.sury.org~precise+1 is to be installed
E: Unable to correct problems, you have held broken packages.

Quando eu instalo as que dizem, não recebo um candidato de instalação.

Obrigado

    
por viv 25.04.2016 / 10:25

2 respostas

0

ok então finalmente isso funcionou: link

sudo add-apt-repository -r ppa:ondrej/php5
sudo add-apt-repository -r ppa:ondrej/php5-oldstable
sudo add-apt-repository -r ppa:ondrej/php5-5.6
sudo apt-get purge php5* apache2* mcrypt*
sudo apt-get update
sudo apt-get upgrade

sudo apt-get install php5 php5-mcrypt php5-curl apache2

sudo php5enmod mcrypt
sudo php5enmod curl

sudo apt-get install php5-gd

Obrigado a todos que me ajudaram.

    
por viv 25.04.2016 / 12:03
0

Estes erros são geralmente (sem apt-cache policy em falta de pacotes, é difícil dizer) manifestação de:

  1. Não usando o PPA, verifique se /etc/apt/sources.list.d/ contém o arquivo ondrej-php5-5_6-trusty.list e se não está vazio ou comentado. Se o arquivo não existir, você deve adicioná-lo novamente usando: sudo add-apt-repository ppa:ondrej/php5-5.6 e prosseguir normalmente.

  2. Usando arquitetura que não é suportada no PPA. Acho que este é o seu caso e o VPS está sendo executado em um Raspberry Pi 2 ou 3. armhf foi adicionado apenas recentemente ao ppa:ondrej/php5 e ppa:ondrej/php5-5.6 , então ainda pode haver alguns pacotes que não foram recompilados e arm64 (para RPi 3) ainda não está habilitado. Ativarei arm64 arquitetura em ambos os PPAs, mas levará algum tempo para que tudo seja recompilado.

por oerdnj 25.04.2016 / 11:49