FAQ

Page Discussion Edit History

InstallingFromDebianRepositories

[edit] Installing recent versions from Debian Repositories (testing and sid)

This assumes you're running Debian 5.0 codename 'Lenny'. The current stable release.

The nginx version in Lenny is quite outdated: instead of creating your own package, the best solution is to apt pin the nginx package in order to use the testing version as opposed to the stable version. As an added bonus you'll usually also get a more recent version of OpenSSL.

Currently the Nginx debian package in the testing respository is 0.7.67, and in sid (unstable) also 0.7.67, albeit with a more recent Debian package.

Edit the /etc/apt/preferences file. If you don't have it then create it. Now add to it:

Package: nginx
Pin: release a=testing
Pin-Priority: 1000

This will make apt prefer to install nginx from testing, while trying to solve all its dependencies using packages from stable first and fetching them from testing if necessary.

Off course, you will need to add the testing repositories to your sources list: /etc/apt/sources.list. Add the lines:

deb http://ftp.debian.org/debian/ testing main contrib
deb-src http://ftp.debian.org/debian/ testing main contrib

Please use the Debian mirror nearest to your location for the repositories.

Next, tell apt or aptitude to update the package list:

apt-get update or aptitude update

Now you're all set. Grab the nginx package from testing.

apt-get install nginx or aptitude install nginx. If you're running a previous version of nginx then when you can run upgrade instead of install. It will fetch all new packages, including a brand new nginx package from the testing release.

If everything goes smoothly you should have a new nginx version installed and running. If something goes wrong and you're upgrading from a previous release then check for changes in the configuration between the previous and the currently installed version of nginx as the probable cause of problems.