3

I am trying to install php5-cli package on my machine but I get the following error for unmet dependencies.

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).

I have tried apt-get install -f, apt-get clean and apt-get autoclean none of which helped. I have tried almost all the solutions given in this post How do I resolve unmet dependencies after adding a PPA? but none of them seemed to work for me.

edit:I tried installing the packages individually using

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

but that didn't seem to work either.

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).

Here is the output for 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

the output to grep -r 'ftp.us.debian.org' /etc/apt/ and apt-cache policy libmaven2-core-java is

/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

And this is the output to the 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

output for 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

I followed the steps in the answer, removed the repository, ran apt-get -f install and had to do an autoremove to remove some packages that were not required anymore. It seemed to have resolved the issue with libmaven2-core-java. I then tried to install php5-cli again but I got the following output.

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.

output to 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

and output to 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.

the output for 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

The output to dpkg -l | grep 'sury' is

ii  php5-json                                            1.3.7-1+deb.sury.org~vivid+1               amd64        JSON module for php5
SHuss
  • 33

1 Answers1

0

You have incompatible software repositories enabled. We can fix this…

  1. Use the main server for the Ubuntu repositories

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

    sudo apt-get install ppa-purge
    

    If an installation isn't possible and ppa-purge isn't installed, download the deb package

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

    extract and copy the executable

    dpkg -x ppa-purge_0.2.8+bzr57_all.deb ppa-purge
    sudo cp ppa-purge/usr/sbin/ppa-purge /usr/sbin
    
  3. Purge the PPA ppa:ondrej/php5-5.6

    sudo ppa-purge ppa:ondrej/php5-5.6
    sudo apt-get update
    
  4. The next error message

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

    You use an additionally Debian repository, http://ftp.us.debian.org/. This repository provides libmaven2-core-java which depends on libdoxia-core-java. But this package isn't available.

    Therefore remove the repository http://ftp.us.debian.org/ in your /etc/apt/sources.list. After that, run

    sudo apt-get update
    

    and downgrade the packages with:

    sudo apt-get install libmaven2-core-java=2.2.1-17
    
  5. Usually not necessary after purging the PPA ppa:ondrej/php5-5.6 with ppa-purge, but in your case downgrade also the packages listed by 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. Repair your installation

    sudo apt-get install -f
    
A.B.
  • 92,125