Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm on Ubuntu 12.04.1 with unattended-upgrades configured for automatic security updates, and I installed Nginx by first adding

deb lucid nginx
deb-src lucid nginx

to /etc/apt/sources.list file, just as was suggested by the official wiki, and then by

sudo apt-get update
sudo apt-get install nginx

which installed Nginx with all the standard modules. But now I think I could make good use of one or two of the Nginx optional modules, like the gzip precompression module or some security-related one. So far, I see two ways of adding an optional module to Nginx, one is compiling and installing from the source code and the other is described in this article.

So, which of the ways should I choose so that automatic updates still run for and apply to Nginx and its optional modules? Or should I create a cron job with a command/script specific for Nginx instead of using unattended-upgrades utility? Can I choose between volume updates and security-only updates to be automatically applied to the standard and optional modules? And finally, is there a possibility to automatically update Nginx's modules on the fly (without any connections having been dropped), like the documentation suggests it's possible with

sudo kill -USR2 $( cat /run/ )

P.S. Actually I'm not certain if unattended-upgrades utility would automatically update the standard modules in the first place, not enough time has passed since Nginx was installed to say for sure.

share|improve this question
up vote 1 down vote accepted

unattended-upgrades only works for applications you've installed using the package manager and that have a package repository associated with them. Basically, how upgrades/updates in general work is that there is a comparison mechanism that the updater watches for. When that comparison comes up with different values for the installed application versus what's in the repository, a update sequence is triggered (either it will update automatically, or will prompt the user to update, depending on the setup and what the changes are).

When you recompile an application, using either of the methods you've mentioned (Stan's method is, in fact, also recompiling, it's just using dpkg instead of make, you break your install away from the repository.

This is reflected in Stan's post by:

Аfter you upgrade to a new version nginx, this recompiled package will be overwritten. You will have to do this process again.

Therefore, your best bet will be to use a cron job and custom script to manage the automatic updating for Nginx. The good news is, though, that you should be able to automate the whole process if you're willing to put in the effort to write and test the appropriate script. Once you get it installed the first time, the script shouldn't have to worry about dependencies, just pull the new source and rebuild with the options you want.

share|improve this answer
Ok, so it's a cron-scheldued script that would download and compile Nginx's source code with the options I need and then reinstall the server? That's fine, but then, if you'd give me a hint, how do I make the script look for and download the latest stable-release source (not a regular development release) but always download the latest security release, no matter if it's stable release or development one? – Desmond Hume Nov 2 '12 at 21:09
My first thought would be to try to watch the SVN repository - . To get stable updates, just watch the branches, while development updates will probably come from the tags. Compare the latest tag and/or branch against the number(s) you have stored, and download if they're different. – Shauna Nov 2 '12 at 21:16
Alright. Thanks a lot. – Desmond Hume Nov 2 '12 at 21:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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