当我试图将php5.3升级到php5.4或更高版本时,我遇到了一些问题。
下面是我输入的apt-get -f install php5.5命令
并由此而来:
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其余的与it is not going to be installed标记的基本相同。
我的操作系统是Ubuntu12.04.5LTS。
看起来,linux-image-generic和linux-headers-generic与需要的人并不匹配。
所以升级没有成功,我仍然停留在php5.3.10上。
我尝试了dpkg --purge linux-image-generic和dpkg --purge linux-headers-generic,但仍然得到了相同的错误。
而dpkg --configure -a也是一个拒绝。
对此有什么想法吗?
在我遵循Arijit的解决方案并键入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).版本仍然是php5.3。而python properties是最新的版本。
这是php5版本的检查。尝试过apt-get install php5.4.45,无法安装。
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在深入了解了情况后,我在这里找到了解决办法。失败计数错误:linux泛型pae:取决于:linux映像泛型pae (= 3.2.0.37.44),但安装了3.2.0.37.45。
解决我的具体问题的方法是@Simon留下的评论
也有同样的问题,但是linux-泛型包取决于linux的特定版本-映像-泛型和linux-标头-泛型,但是要安装的更新版本会导致“未满足的依赖关系”错误。用
sudo dpkg --remove linux-generic && sudo apt-get install linux-generic解决了。谢谢!
所以解决办法很简单,
sudo dpkg --remove linux-genericsudo apt-get linux-genericLC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/phpapt-get updateapt-get install php5.6或php7LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php获得最新版本的安全稳定的php。apt-get install php5.6或php7.2015年不再支持php5.4及更低版本。sudo service apache2 restart和sudo service nginx restart发布于 2017-03-09 09:23:45
请跟我来这里:
sudo apt-get update && sudo apt-get install python-software-propertiessudo add-apt-repository ppa:ondrej/phpsudo apt-get updateapt-cache policy php5sudo apt-get install php5.4php5 -v,如果不是php5.4,那么重新启动Apache sudo /etc/init.d/apache2 restart或sudo service apache2 restart希望它能得到解决
https://askubuntu.com/questions/891145
复制相似问题