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
apt-cache policy php5-cli; apt-cache policy libmaven2-core-java; apt-cache policy libdoxia-core-java; apt-cache policy libonig2
– A.B. Sep 07 '15 at 06:16apt-cache policy php5-readline
too – A.B. Sep 07 '15 at 15:09grep -r 'ftp.us.debian.org' /etc/apt/
andapt-cache policy libmaven2-core-java
– A.B. Sep 08 '15 at 10:07apt-cache policy libmaven2-core-java
– A.B. Sep 08 '15 at 16:06sudo apt-get update
– A.B. Sep 09 '15 at 19:20sudo apt-get update
now. – A.B. Sep 10 '15 at 05:13sudo apt-get install -f;; sudo apt-get install php5-cli
– A.B. Sep 10 '15 at 05:19apt-cache policy php5-common
– A.B. Sep 10 '15 at 05:45sudo apt-get install php5-common=5.6.4+dfsg-4ubuntu6.2
– A.B. Sep 10 '15 at 07:17sudo apt-get install php5-json=1.3.2-2build1
– A.B. Sep 10 '15 at 09:18