Why was an older version of Nginx installed?

DaAwesomeP asked:

I installed Nginx and PHP5-FPM and have it all working, but I noticed that I have Nginx 1.2.1 installed and not the most recent stable version (1.6.x). I also noticed that PHP-FPM had PHP 5.4 and not PHP 5.5. However, that is not as much a security problem as the old Nginx version.

How I installed:

  1. Added deb http://nginx.org/packages/debian/ wheezy nginx to /etc/apt/sources.list. I also correctly added the PGP key.
  2. su
  3. apt-get update The Nginx server was listed during the update and there were no errors.
  4. apt-get install nginx-extras php5-fpm
  5. I then configured both to my liking. I also realized I had an old version of Nginx.
  6. I did apt-cache show nginx-common and saw the old version.
  7. I tried apt-get upgrade to no avail.

Output of apt-cache show nginx-common:

Package: nginx-common
Source: nginx
Version: 1.2.1-2.2+wheezy3
Installed-Size: 203
Maintainer: Kartik Mistry <kartik@debian.org>
Architecture: all
Replaces: nginx (<< 0.8.54-4), nginx-extras (<< 0.8.54-4), nginx-full (<< 0.8.54-4), nginx-light (<< 0.8.54-4)
Depends: lsb-base (>= 3.2-14)
Breaks: nginx (<< 0.8.54-4), nginx-extras (<< 0.8.54-4), nginx-full (<< 0.8.54-4), nginx-light (<< 0.8.54-4)
Description-en: small, powerful, scalable web/proxy server - common files
 Nginx ("engine X") is a high-performance web and reverse proxy server
 created by Igor Sysoev. It can be used both as a standalone web server
 and as a proxy to reduce the load on back-end HTTP or mail servers.
 .
 This package contains base configuration files used by all versions of
 nginx.
Homepage: http://nginx.net
Description-md5: 9e23931d84d07adbee5412aefdad8a90
Tag: role::app-data
Section: httpd
Priority: optional
Filename: pool/main/n/nginx/nginx-common_1.2.1-2.2+wheezy3_all.deb
Size: 72790
MD5sum: 45164faa28f8937d2864d1ccb5a8787f
SHA1: ff54c828017f7866cc84cf23eb54e516a07f81a8
SHA256: 3c87c9377d66c574c45c977a602fa01d26e57b89b7cb1a8751fee4ab8f0e1225

Debian Wheezy 7.7 i686-pae

My answer:


You installed the wrong packages.

You’ve added the upstream nginx repository to your server, but in this repo the nginx package is simply named nginx. There are no other packages to install; those are Debian-specific (and often confusing).

To resolve the problem, remove the packages you installed, then install the nginx package.

sudo apt-get purge nginx-common nginx-extras
sudo apt-get autoremove  ## optional
sudo apt-get install nginx

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.