ubuntu22.04 安装nginx 卸载

1、使用apt-get 安装nginx(得机器能联网才行)

# 切换到root用户

# 切换到root用户
  sudo -i 
# 更新apt源
  apt-get update
# 安装nginx
  apt-get install nginx -y

 

 2、访问nginx

# 检查防火墙状态
root@control01:~# ufw status
Status: inactive

防火墙没启动,我们可以直接访问

 3、卸载nginx

# 停止nginx进程
  cd /usr/sbin && ./nginx -s stop

 

 

 

# 删除nginx,--purge包括配置文件
apt-get --purge remove nginx
# 自动移除不使用的软件包
apt-get autoremove
# 罗列出与nginx相关的软件
dpkg --get-selections|grep nginx
# 删除上一步中查询出的软件
apt-get --purge remove nginx-common
...

 

 

 至此nginx就卸载干净了。

posted @ 2023-01-03 10:36  高佳丰  阅读(1240)  评论(0编辑  收藏  举报