在Ubuntu上如何卸载nginx

1、Ubuntu下安装Nginx

sudo apt-get update
sudo apt-get install nginx

2、在Ubuntu上卸载nginx

# 删除除了配置文件以外的所有文件。
sudo apt-get remove nginx nginx-common
# 删除所有与nginx有关的东西,包括配置文件。 
sudo apt-get purge nginx nginx-common 
# 在上面命令结束后执行,主要是删除与Nginx有关的且不再被使用的依赖包。
sudo apt-get autoremove 
# 删除两个主要的包。
sudo apt-get remove nginx-full nginx-common 

3、验证是否成功卸载nginx

#重启nginx,重启失败,说明已成功卸载nginx
sudo service nginx restart  

谢谢阅读!

猜你喜欢

转载自blog.csdn.net/weixin_40763897/article/details/90722050