How to Reset Nginx (HRN)



AVAILABLE:    5

I accidentally deleted the /etc/nginx directory on my Ubuntu 11.10 PC. How can I restore the Nginx directory in /etc/nginx?

Here’s what I did:

sudo su
rm -rf /etc/nginx

I want to restore the /etc/nginx directory. How can I do that?

I tried reinstalling Nginx using the following commands:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install nginx

But it resulted in the following output:

Reading package lists... Done

Building dependency tree   

Reading state information... Done
E: Unable to locate package nginx

Solution

To restore it, first uninstall Nginx completely using the purge option to remove even configuration files and records:

sudo apt-get purge nginx nginx-common nginx-full

Then reinstall it:

sudo apt-get install nginx

If the above steps don’t work for you, you can also try using the --force-confmiss option of dpkg:

sudo dpkg --force-confmiss -i /var/cache/apt/archives/nginx-common


Post a Comment

Previous Next

نموذج الاتصال