我使用 ubuntu 16.04。我已删除 nginx 配置
$ sudo rm -rvf /etc/nginx/
清除 nginx 并再次安装
# apt-get remove --purge nginx
# apt install nginx
aptitude 显示 nginx 已安装
能力搜索 nginx
p lua-nginx-websocket - Lua websocket client driver for the nginx embedded Lua langu
i nginx - small, powerful, scalable web/proxy server
v nginx:i386 -
i A nginx-common - small, powerful, scalable web/proxy server - common files
i A nginx-core - nginx web/proxy server (core version)
p nginx-core:i386 - nginx web/proxy server (core version)
但是命令 # ls /etc/n* 显示没有安装 nginx 配置文件?
到底是怎么回事?
关注此页面:https://askubuntu.com/questions/361902/how-to-install-nginx-after-removed-it-manually
我已经删除了 nginx 并再次安装。安装时我收到以下警告。
Selecting previously unselected package nginx.
dpkg: warning: files list file for package 'nginx-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'nginx-core' missing; assuming package has no files currently installed
答案1
因此,如果您想重新创建 /etc/nginx 文件,您应该执行以下操作:
sudo apt-get install --reinstall nginx-common