1.卸载软件和配置文件
sudo apt-get --purge remove nginx删除 nginx,配置文件 –purge
2.移除全部不使用的软件包
sudo apt-get autoremove
3.列出nginx相关的软件
dpkg --get-selections|grep nginx执行结果:
zhangsan@xx-ubuntu:~$ dpkg --get-selections|grep nginx
nginx                       install
nginx-common                install
nginx-core                  install
4.删除nginx相关的软件
sudo apt-get --purge remove nginx
sudo apt-get --purge remove nginx-common
sudo apt-get --purge remove nginx-core这样就可以完全卸载掉nginx包括配置文件
5.查看nginx正在运行的进程,如果有就杀掉
ps -ef |grep nginxzhangsan@xx-ubuntu:~$ ps -ef |grep nginx
root      7875  2317  0 15:02 ?        00:00:00 nginx: master process /usr/sbin/nginx
www-data  7876  7875  0 15:02 ?        00:00:00 nginx: worker process
www-data  7877  7875  0 15:02 ?        00:00:00 nginx: worker process
www-data  7878  7875  0 15:02 ?        00:00:00 nginx: worker process
www-data  7879  7875  0 15:02 ?        00:00:00 nginx: worker process
stephen   8321  3510  0 15:20 pts/0    00:00:00 grep --color=auto nginx6.kill nginx进程
sudo kill  -9  7875 7876 7877 7879
7.全局查找与nginx相关的文件
sudo  find  /  -name  nginx*
8.依依删除4列出的所有文件
sudo rm -rf file
9.再次重装
sudo apt-get update && sudo apt-get install nginx            
                
            
        
                    
                    
评论 (0)