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 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.