首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >升级时出现“linux-映像-泛型”错误

升级时出现“linux-映像-泛型”错误
EN

Ask Ubuntu用户
提问于 2017-03-09 07:49:15
回答 1查看 1.8K关注 0票数 0

当我试图将php5.3升级到php5.4或更高版本时,我遇到了一些问题。

下面是我输入的apt-get -f install php5.5命令

并由此而来:

代码语言:javascript
复制
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-genericlinux-headers-generic与需要的人并不匹配。

所以升级没有成功,我仍然停留在php5.3.10上。

我尝试了dpkg --purge linux-image-genericdpkg --purge linux-headers-generic,但仍然得到了相同的错误。

dpkg --configure -a也是一个拒绝。

对此有什么想法吗?

更新:

在我遵循Arijit的解决方案并键入apt-get install php5之后

代码语言:javascript
复制
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,无法安装。

代码语言:javascript
复制
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:

在深入了解了情况后,我在这里找到了解决办法。失败计数错误: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解决了。谢谢!

所以解决办法很简单,

  1. sudo dpkg --remove linux-generic
  2. sudo apt-get linux-generic
  3. 重复安装php的过程。
    • LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
    • apt-get update
    • apt-get install php5.6php7

  4. 请注意不要使用不推荐的PPA版本,请使用LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php获得最新版本的安全稳定的php。
  5. apt-get install php5.6php7.2015年不再支持php5.4及更低版本。
  6. 现在您已经成功地安装了php5.6和更高版本。如果没有,则重新启动服务。sudo service apache2 restartsudo service nginx restart
EN

回答 1

Ask Ubuntu用户

发布于 2017-03-09 09:23:45

请跟我来这里:

  1. 您必须首先更新并安装Properties sudo apt-get update && sudo apt-get install python-software-properties
  2. 现在添加一个PPA sudo add-apt-repository ppa:ondrej/php
  3. 现在再更新一次sudo apt-get update
  4. 检查可用的php5版本apt-cache policy php5
  5. 现在安装php5.x sudo apt-get install php5.4
  6. 现在检查php版本php5 -v,如果不是php5.4,那么重新启动Apache sudo /etc/init.d/apache2 restartsudo service apache2 restart

希望它能得到解决

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/891145

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档