I encountered some problem while I was trying to upgrade my php5.3 to php5.4 or higher version.
Here's the command I typed apt-get -f install php5.5
And came out of this:
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
linux-generic : Depends: linux-image-generic (= 3.2.0.116.132) but 3.2.0.124.139 is to be installed
Depends: linux-headers-generic (= 3.2.0.116.132) but 3.2.0.124.139 is to be installed
php-amqp : Depends: php-common (>= 1:7.0+33~) but it is not going to be installed
Depends: phpapi-20160303 or
phpapi-20151012 or
phpapi-20131226 or
phpapi-20121212 but it is not installable
Depends: librabbitmq4 (>= 0.6.0) but it is not going to be installed
php-gearman : Depends: php-common (>= 1:7.0+33~) but it is not going to be installed
Depends: phpapi-20160303 or
phpapi-20151012 or
phpapi-20131226 or
phpapi-20121212 but it is not installable
Depends: libgearman8 (>= 1.1.13) but it is not going to be installed
php-geoip : Depends: php-common (>= 1:7.0+33~) but it is not going to be installed
The rest is pretty much the same labeled with it is not going to be installed
My OS is Ubuntu 12.04.5 LTS.
It looks like the linux-image-generic
and linux-headers-generic
aren't matched to the one in need.
So the upgrade wasn't success and I was still stuck on php5.3.10.
I tried dpkg --purge linux-image-generic
and dpkg --purge linux-headers-generic
but still get the same error.
And dpkg --configure -a
is also a no go.
Thoughts on this?
UPDATE:
After I followed Arijit's solution and typed apt-get install php5
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:
linux-generic : Depends: linux-image-generic (= 3.2.0.116.132) but 3.2.0.124.139 is to be installed
Depends: linux-headers-generic (= 3.2.0.116.132) but 3.2.0.124.139 is to be installed
php5 : Depends: libapache2-mod-php5 (>= 5.4.45-4+deprecated+dontuse+deb.sury.org~precise+1) but 5.3.10-1ubuntu3.26 is to be installed or
libapache2-mod-php5filter (>= 5.4.45-4+deprecated+dontuse+deb.sury.org~precise+1) but it is not going to be installed or
php5-cgi (>= 5.4.45-4+deprecated+dontuse+deb.sury.org~precise+1) but it is not going to be installed or
php5-fpm (>= 5.4.45-4+deprecated+dontuse+deb.sury.org~precise+1) but it is not going to be installed
Depends: php5-common (>= 5.4.45-4+deprecated+dontuse+deb.sury.org~precise+1) but 5.3.10-1ubuntu3.26 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
The version is still php5.3. And the python properties
is the latest version.
This is the checks of the php5 versions. Tried apt-get install php5.4.45
, couldn't be installed.
php5:
Installed: (none)
Candidate: 5.4.45-4+deprecated+dontuse+deb.sury.org~precise+1
Version table:
5.4.45-4+deprecated+dontuse+deb.sury.org~precise+1 0
500 http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu/ precise/main amd64 Packages
5.3.10-1ubuntu3.26 0
500 http://archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
5.3.10-1ubuntu3 0
500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
UPDATE2:
After I dug a little more about the situation, I found solution here. Broken count error : linux-generic-pae : Depends: linux-image-generic-pae (= 3.2.0.37.44) but 3.2.0.37.45 is installed
And the solution for my specific problem is the comment left by @Simon
Had the same problem but with linux-generic package depending on a specific version of linux-image-generic and linux-headers-generic, but a newer version to be installed caused 'Unmet dependencies' error. Solved it with
sudo dpkg --remove linux-generic && sudo apt-get install linux-generic
. Thanks!
So the solution is pretty simple,
sudo dpkg --remove linux-generic
sudo apt-get linux-generic
Repeat the procedure of installing the php.
LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
apt-get update
apt-get install php5.6
orphp7
Noted that don't use Deprecated version of the PPA, please use
LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
to get the latest version of safe and stable php.apt-get install php5.6
orphp7
. php5.4 and lower are not supported anymore in 2015.- There you have it, now you have successfully installed php5.6 and higher version. If not then restart your service.
sudo service apache2 restart
andsudo service nginx restart