重装nginx遇到的问题
不能正常启动nginx
dpkg: error processing package nginx (--configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Errors were encountered while processing:
nginx-core
nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)
查看nginx.service状态
systemctl status nginx.service
查看80端口的是否已在使用中,可验证使用该端口的服务是否已正常运行
netstat -an | grep :80
如果不是端口占用的问题
1.卸载nginx不保留配置文件
2.卸载自动安装且不再需要的依赖包
sudo apt-get --purge remove nginx
apt-get autoremove
查看与nginx有关的包
dpkg --get-selections | grep nginx
还有
nginx-common deinstall
再次清理
sudo apt-get --purge remove nginx-common
重新安装nginx
连接 https://segmentfault.com/a/1190000014027697?utm_source=tag-newest