nginx配置失败,卸载后重装无 nginx.conf文件

在ubuntu环境下我是用 sudo apt  install nginx 安装的,由于配置项目时一真不成功,直接把nginx卸载了,想从新安装。后来卸载的时候我就简单的使用了sudo apt remove nginx

之后就碰到了再安装即使提示安装成功,也找不到路径文件的问题

随后按照其网友的经验

实验如下

sudo apt-get --purge remove nginx
sudo apt-get install nginx
然后并没有什么卵用

接着再试如下

sudo apt-get --purge remove nginx
sudo apt-get autoremove
sudo apt-get install nginx
有作用了,有了/etc/nginx文件夹,但是配置文件只有2个

然后再删除一遍

sudo apt-get --purge remove nginx
sudo apt-get autoremove
dpkg --get- selections|grep nginx
并找到和nginx有关系的软件文件

接着删除这个文件,并重装

sudo apt-get --purge remove nginx-common
sudo apt-get install nginx
然后就恢复原样了

这里参考了其他网友的文章

http://www.2cto.com/os/201506/404306.html
 

你可能感兴趣的:(nginx配置失败,卸载后重装无 nginx.conf文件)