如何恢复/ etc / nginx?[关闭]


104

我错误地在ubuntu 11.10 PC中删除了/ etc / nginx目录。如何还原/ etc / nginx中的ngnix目录?

我做了这些命令:

  1. sudo su
  2. rm -rf /etc/nginx

我想再次获得/ etc / nginx目录。怎么样?

我试过这个来重新安装nginx:

  1. sudo apt-get update
  2. sudo apt-get upgrade
  3. sudo apt-get install nginx

然后给出以下

Reading package lists... Done

Building dependency tree   

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

如何在ubuntu 11.10上获得完整的nginx软件?


我有这些错误ln: failed to create symbolic link ‘/etc/nginx/modules-enabled/50-mod-http-auth-pam.conf’: and dpkg:错误处理软件包libnginx-mod-http-auth-pam(--configure):`没有这样的文件或目录,下面的答案很有用。谢谢。
jmunsch

Answers:


288

要重新创建它,请先使用purge卸载,甚至删除配置文件和记录:

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

然后重新安装:

sudo apt-get install nginx

如果上述方法对您不起作用,您也可以尝试使用dpkg的--force-confmiss选项。

sudo dpkg --force-confmiss -i /var/cache/apt/archives/nginx-common_*.deb 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.