首页  编辑  

升级Apache 2

Tags: /计算机文档/Linux & Unix/   Date Created:

强制升级Apache 2:

升级前用apache2 -v查看版本

sudo add-apt-repository ppa:ondrej/php5

sudo add-apt-repository ppa:ondrej/apache2

sudo apt-get update

sudo apt-get upgrade

sudo apt-cache policy apache2

上面指令运行后,会显示类似下面的内容:

apache2:

 Installed: 2.4.7-1ubuntu4.4

 Candidate: 2.4.12-1+deb.sury.org~trusty+5

 Version table:

    2.4.12-1+deb.sury.org~trusty+5 0

       500 http://ppa.launchpad.net/ondrej/apache2/ubuntu/ trusty/main amd64 Packages

       500 http://ppa.launchpad.net/ondrej/php5/ubuntu/ trusty/main amd64 Packages

*** 2.4.7-1ubuntu4.4 0

       500 http://cn.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages

       500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages

       100 /var/lib/dpkg/status

    2.4.7-1ubuntu4 0

       500 http://cn.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

最后,运行下面的指令,注意代入Candidate后面的包名:

sudo apt-get install apache2=2.4.12-1+deb.sury.org~trusty+5

即可强制升级Apache2

升级完后,再用 apache2 查看版本:

Server version: Apache/2.4.12 (Ubuntu)

Server built:   Feb  4 2015 14:20:03