记一次卸载重装nginx遇到的问题

卸载nginx不保留配置文件

$ sudo apt-get --purge remove nginx

卸载自动安装且不再需要的依赖包

$ sudo apt-get autoremove

筛选已安装软件包中与nginx有关的

$ dpkg --get-selections | grep nginx

nginx-common                                    deinstall

卸载nginx-common不保留配置文件

$ sudo apt-get --purge remove nginx-common

重新安装nginx

$ sudo apt-get install nginx
...
查看版本号,执行nginx配置文件语法检测

$ nginx -v
nginx version: nginx/1.10.3 (Ubuntu)
$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容