127

我错误地删除了 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 软件?

4

1 回答 1

363

要重新创建它,首先使用 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 
于 2012-09-11T05:20:57.793 回答