No se puede instalar PHP en Debian

Cuando se ejecuta sudo apt-get install php7.0 aparece el error:

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:
 php : Depends: php7.0 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Se debe ejecutar el siguiente comando para verificar que PPAs tenemos configurados:

LC_ALL=C apt policy

Si la salida es esta:

 500 http://ppa.launchpad.net/ondrej/php/ubuntu disco/main amd64 Packages
     release v=19.04,o=LP-PPA-ondrej-php,a=disco,n=disco,l=***** The main PPA fo                                                                             r supported PHP versions with many PECL extensions *****,c=main,b=amd64
     origin ppa.launchpad.net

Quiere decir que hemos roto el sistema agregando fuentes extranjeras, hay que eliminar las fuentes php del sourcelist:

cd /etc/apt/sources.list.d/

Eliminar las fuentes php:

rm ondrej-ubuntu-php-disco.list
rm ondrej-ubuntu-php-disco.list.save
rm php7.3.list
rm php7.3.list.save

Actualizar e instalar

apt-get update
apt-get install php

Y listo.

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments