ubuntu意外删除/etc/nginx后如何恢复?


1、使用purge卸载

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

2、重新安装

sudo apt-get install nginx

3、测试

nginx -t

4、若上述方案不起作用,请尝试使用dpkg的--force-confmiss选项

sudo dpkg --force-confmiss -i /var/cache/apt/archives/nginx-common_*.deb