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 deleted etc/nginx by mistake and now i am stuck. I tried compiling by source and repository but didn't get it back. Some please help me asap to fix this problem. A detail explanation will be most appreciated.

share|improve this question
Your settings are gone, but I believe you can purge and reinstall. sudo apt-get purge nginx* then, sudo apt-get install nginx – Brandon Bertelsen Dec 9 '12 at 7:22
Not working mate.Any other suggestion? – Vinit Kumar Dec 10 '12 at 12:08
Try, dpkg-reconfigure nginx – Brandon Bertelsen Dec 10 '12 at 20:01
up vote 2 down vote accepted

Well the obvious course of action is:

  1. restore from backup
    • best option here: have etckeeper installed and configured and running and restore the latest configuration ... depending on the backend for etckeeper make sure that you clone it to another machine, i.e. include it in your backup strategy.
  2. Run sudo dpkg-reconfigure nginx
  3. reinstall the nginx package after purging it, thus restoring the default configuration. Make sure to purge, not just to remove.

To reiterate: etckeeper is a convenient and unified frontend to various distributed version control systems. You should use it to protect yourself from disaster and keep an off-site backup of the underlying repository.

share|improve this answer

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.