I'm trying to upgrade my nginx install to 1.3+. I already added the PPA for nginx/development and updated with apt-get update.

I ran this command to install nginx:

me@server:~$ sudo apt-get install nginx
... snip ...
Unpacking nginx (from .../nginx_1.5.0-1~ppa1~raring_all.deb) ...
Setting up nginx (1.5.0-1~ppa1~raring) ...


me@server:~$ nginx -v
nginx version: nginx/1.2.6 (Ubuntu)

It looks like it installed nginx 1.5, but installed it someplace wacky. I have no idea how to find it if it did. What am I doing wrong?

  • 2
    You've probably installed an nginx from source of which your package management has no knowledge. Don't do that. Please post the output of which nginx in your question as well as dpkg -L nginx. – gertvdijk Aug 17 '13 at 22:46

First, you should check whether the 1.5.0 package has actually been successfully installed. Maybe you missed an error message. You can see the currently installed version of a package, among other things, in the output of apt-cache policy packagename, in your case apt-cache policy nginx.

If the new package has been installed correctly, maybe you need to restart nginx to have it "realize" it has been upgraded.

To find out where the files from a package went in your file system, you can use the -L switch of dpkg. In your case, something like dpkg -L nginx should give you a list. Maybe the binary of the newer version went to another directory in your path than the older version's one, so the older one has precendence. You can check where the binary of an command is with whereis. So whereis nginx should tell you where the nginx binary you are using is located. Maybe there are remnants of the 1.2.6 version.

My knowledge of nginx is limited, but I would check the following possibilities additionally:

  • Maybe the name of the binary changed from 1.2.6 to 1.5.0 and it isn't nginx -v anymore, but nginx15 -v or something similar?
  • Maybe the 1.5.0 version identifies itself as 1.2.6 for some reason? I vaguely remember something similar around Ruby from not too long ago, where 1.9.3 packages were names as "1.9.1" for reasons of compatibility to other stuff.
  • Maybe the PPA's packages are not meant to upgrade an existing nginx, but to run parallel with it? I can imagine installing a so far unstable development version alongside an older stable version.
  • Maybe the packager just did something wrong and shipped an 1.2.6 version by mistake.

Much of the above is speculation, but it should give you some pointers where to look.

| improve this answer | |
  • Thank you, this has been really helpful in helping me to find the problem. It seems that what i needed to do was install nginx-full not just nginx – leech Aug 17 '13 at 23:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.