Problema ao instalar o php-cli

3

Estou tentando instalar o pacote php5-cli na minha máquina, mas recebo o seguinte erro para dependências não atendidas.

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:
 libmaven2-core-java : Depends: libdoxia-core-java (>= 1.1) but it is not going to be installed
 php5-cli : Depends: libonig2 (>= 5.9.5) but it is not going to be installed
            Depends: libqdbm14 (>= 1.8.74) but it is not going to be installed
            Depends: php5-common (= 5.6.12+dfsg-1+deb.sury.org~vivid+1) but it is not going to be installed
            Depends: php5-json but it is not going to be installed
            Recommends: php5-readline but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Eu tentei o apt-get install -f, o apt-get clean e o apt-get autoclean, nenhum dos quais ajudou. Eu tentei quase todas as soluções dadas neste post Como resolvo dependências não satisfeitas depois de adicionar um PPA? mas nenhum deles pareceu funcionar para mim.

edit: Eu tentei instalar os pacotes individualmente usando

sudo apt-get install php5-readline php5-json php5-common libqdbm14 libonigia-core-java libmaven2-core-java 2 libdox

mas isso também não parece funcionar.

Reading package lists... Done
Building dependency tree       
Reading state information... Done
libonig2 is already the newest version.
libmaven2-core-java is already the newest version.
libmaven2-core-java set to manually installed.
libqdbm14 is already the newest version.
php5-common is already the newest version.
php5-json is already the newest version.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 php5-readline : Depends: php5-cli (= 5.6.12+dfsg-1+deb.sury.org~vivid+1) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Aqui está a saída para o apt-cache policy php5-readline

php5-readline:
  Installed: (none)
  Candidate: 5.6.12+dfsg-1+deb.sury.org~vivid+1
  Version table:
     5.6.12+dfsg-1+deb.sury.org~vivid+1 0
        500 http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu/ vivid/main amd64 Packages
     5.6.12+dfsg-1 0
        500 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
     5.6.4+dfsg-4ubuntu6.2 0
        500 http://pk.archive.ubuntu.com/ubuntu/ vivid-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ vivid-security/main amd64 Packages
     5.6.4+dfsg-4ubuntu6 0
        500 http://pk.archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages

a saída para grep -r 'ftp.us.debian.org' /etc/apt/ and apt-cache policy libmaven2-core-java é

/etc/apt/sources.list:deb http://ftp.us.debian.org/debian unstable main contrib non-free
/etc/apt/sources.list.save:deb http://ftp.us.debian.org/debian unstable main contrib non-free
/etc/apt/sources.list.bak:deb http://ftp.us.debian.org/debian unstable main contrib non-free
grep: and: No such file or directory
grep: apt-cache: No such file or directory
grep: policy: No such file or directory
grep: libmaven2-core-java: No such file or directory

E esta é a saída para o script:

alsa-base http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
cgroupfs-mount http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
curl http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
dmsetup http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
dnsmasq-base http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libarchive13 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libcurl3-gnutls http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libdevmapper1.02.1 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libeclipse-aether-java http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libgnutls-deb0-28 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libgnutls-deb0-28 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libgnutls-openssl27 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libgrpc-dev http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libgrpc0 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libhogweed4 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libhogweed4 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libjsch-java http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libnettle6 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libnettle6 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
librtmp1 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
librtmp1 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libsisu-inject-java http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libssh2-1 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libssl-dev http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libssl1.0.0 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libssl1.0.0 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libtasn1-6 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libtasn1-6 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libunwind8 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libwagon-java http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libwagon2-java http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
pepperflashplugin-nonfree http://ftp.us.debian.org/debian/ unstable/contrib amd64 Packages

saída para apt-cache policy libmaven2-core-java

libmaven2-core-java:
  Installed: 2.2.1-22
  Candidate: 2.2.1-22
  Version table:
 *** 2.2.1-22 0
        500 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
        100 /var/lib/dpkg/status
     2.2.1-17 0
        500 http://archive.ubuntu.com/ubuntu/ vivid/universe amd64 Packages

Eu segui os passos da resposta, removi o repositório, executei o apt-get -f install e tive que fazer um autoremove para remover alguns pacotes que não eram mais necessários. Parecia ter resolvido o problema com o libmaven2-core-java. Eu tentei instalar o php5-cli novamente, mas recebi a seguinte saída.

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-cli : Depends: php5-common (= 5.6.4+dfsg-4ubuntu6.2) but 5.6.12+dfsg-1+deb.sury.org~vivid+1 is to be installed
            Recommends: php5-readline but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

saída para o sudo apt-get install -f

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 53 not upgraded

e saída para o sudo apt-get install php5-cli

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-cli : Depends: php5-common (= 5.6.4+dfsg-4ubuntu6.2) but 5.6.12+dfsg-1+deb.sury.org~vivid+1 is to be installed
            Recommends: php5-readline but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

a saída para o apt-cache policy php5-common

php5-common:
  Installed: 5.6.12+dfsg-1+deb.sury.org~vivid+1
  Candidate: 5.6.12+dfsg-1+deb.sury.org~vivid+1
  Version table:
 *** 5.6.12+dfsg-1+deb.sury.org~vivid+1 0
        100 /var/lib/dpkg/status
     5.6.4+dfsg-4ubuntu6.2 0
        500 http://archive.ubuntu.com/ubuntu/ vivid-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ vivid-security/main amd64 Packages
     5.6.4+dfsg-4ubuntu6 0
        500 http://archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages

A saída para dpkg -l | grep 'sury' é

ii  php5-json                                            1.3.7-1+deb.sury.org~vivid+1               amd64        JSON module for php5
    
por SHuss 06.09.2015 / 22:02

1 resposta

0

Você tem repositórios de software incompatíveis ativados. Nós podemos consertar isso ...

  1. Use o servidor principal para os repositórios do Ubuntu

    sudo sed -i.bak 's/http:\/\/pk\./http:\/\//' /etc/apt/sources.list
    sudo apt-get update
    
  2. Instale ppa-purge

    sudo apt-get install ppa-purge
    

    Se uma instalação não for possível e ppa-purge não estiver instalado, faça o download do pacote deb

    cd ..
    wget http://mirrors.kernel.org/ubuntu/pool/universe/p/ppa-purge/ppa-purge_0.2.8+bzr57_all.deb
    

    extraia e copie o executável

    dpkg -x ppa-purge_0.2.8+bzr57_all.deb ppa-purge
    sudo cp ppa-purge/usr/sbin/ppa-purge /usr/sbin
    
  3. Purgue o Ppa ppa: ondrej / php5-5.6

    sudo ppa-purge ppa:ondrej/php5-5.6
    sudo apt-get update
    
  4. A próxima mensagem de erro

    libmaven2-core-java : Depends: libdoxia-core-java (>= 1.1) but it is not going to be installed
    

    Você usa um repositório adicional da Debian, http://ftp.us.debian.org/ . Este repositório fornece libmaven2-core-java , que depende de libdoxia-core-java . Mas este pacote não está disponível.

    Portanto, remova o repositório http://ftp.us.debian.org/ no seu /etc/apt/sources.list . Depois disso, corra

    sudo apt-get update
    

    e faça o downgrade dos pacotes com:

    sudo apt-get install libmaven2-core-java=2.2.1-17
    
  5. Normalmente, não é necessário depois de limpar o PPA ppa:ondrej/php5-5.6 com ppa-purge , mas, no seu caso, o downgrade também dos pacotes listados por dpkg -l | grep 'sury'

    sudo apt-get install php5-common=5.6.4+dfsg-4ubuntu6.2 
    sudo apt-get install php5-json=1.3.2-2build1
    
  6. Repare sua instalação

    sudo apt-get install -f
    
por A.B. 08.09.2015 / 07:11