ubuntu14.04彻底删除nginx

前端之家收集整理的这篇文章主要介绍了ubuntu14.04彻底删除nginx前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。


http://blog.csdn.net/u010571844/article/details/50819704

1.先执行一下命令:

1.1 删除Nginx,–purge包括配置文件

 
 
  • 1
  • 1
sudo apt-get --purge remove Nginx

1.2 自动移除全部不使用的软件包

  
  
  • 1
  • 2
    • 1
    • 2
    sudo apt-get autoremove

    1.3 罗列出与Nginx相关的软件

      
      
  • 1
  • dpkg --get-selections|grep Nginx
      
      
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    执行1.3的结果: stephen@stephen-OptiPlex-390:~$ dpkg --get-selections|grep Nginx Nginx install Nginx-common install Nginx-core install

    1.4 删除1.3查询出与Nginx有关的软件

      
      
  • 1
  • 2
  • 3
    • 1
    • 2
    • 3
    sudo apt---purge remove Nginx sudo apt---purge remove Nginx-common sudo apt---purge remove Nginx-core

    这样就可以完全卸载掉Nginx包括配置文件

    2.查看Nginx正在运行的进程,如果有就kill掉

      
      
  • 1
  • ps -ef |grep Nginx

    看下Nginx还有没有启动,一般执行完1后,Nginx还是启动着的,如下:

      
      
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    stephen@stephen-OptiPlex-390:~$ ps -ef |grep Nginx root 7875 2317 0 15:02 ? 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 20 pts/0 00 grep --color=auto Nginx

    3.kill Nginx进程

      
      
  • 1
  • sudo kill -9 7875 7876 7877 7879

    4.全局查找与Nginx相关的文件

    sudo  find  /  -name  Nginx*

    5.依依删除4列出的所有文件

    sudo rm -rf file

    这样就彻底删除Nginx

    6. 再次重装

    sudo apt-get update
    sudo apt-get install Nginx
    原文链接:https://www.f2er.com/ubuntu/356127.html

    猜你在找的Ubuntu相关文章