温馨提示×

如何卸载Ubuntu的VNC

小樊
47
2026-08-23 07:11:10
栏目: 智能运维

在 Ubuntu 上卸载 VNC,具体步骤取决于你用的是哪种 VNC 服务(如 TigerVNCx11vncRealVNCGNOME 自带的远程桌面 等)。下面按常见情况说明。


一、先确认你安装的是哪种 VNC

查看已安装的 VNC 相关包:

dpkg -l | grep vnc

常见输出:

  • tigervnc-* → TigerVNC
  • x11vnc → x11vnc
  • vnc4server → 老版本 VNC
  • gnome-remote-desktop → GNOME 自带远程桌面(Wayland)

二、卸载常见 VNC 服务

✅ 1. 卸载 TigerVNC

sudo apt remove --purge tigervnc-*
sudo apt autoremove

✅ 2. 卸载 x11vnc

sudo apt remove --purge x11vnc
sudo apt autoremove

✅ 3. 卸载 vnc4server(老版本)

sudo apt remove --purge vnc4server
sudo apt autoremove

✅ 4. 卸载 GNOME 远程桌面(Ubuntu 22.04+)

如果你用的是 Ubuntu 自带的“远程桌面”

sudo apt remove --purge gnome-remote-desktop
sudo apt autoremove

或在图形界面中:

设置 → 共享 → 远程桌面 → 关闭


三、清理残留配置(可选但推荐)

rm -rf ~/.vnc
rm -rf ~/.config/gnome-remote-desktop

四、停止并禁用 VNC 服务(如果还在运行)

查看服务状态:

systemctl --user status vnc*

停止并禁用(示例):

systemctl --user stop vncserver@*
systemctl --user disable vncserver@*

如果是系统级服务:

sudo systemctl stop vncserver
sudo systemctl disable vncserver

五、确认端口是否还在监听

ss -lntp | grep 590

如果没有输出,说明 VNC 已完全关闭。


六、如果你不确定用的是哪种 VNC

可以把下面命令的输出发给我,我可以帮你精确判断:

dpkg -l | grep vnc
systemctl list-units --type=service | grep -i vnc

✅ 总结(最常用)

如果你只是想“彻底卸载 VNC”,通常执行:

sudo apt remove --purge x11vnc tigervnc-* vnc4server gnome-remote-desktop
sudo apt autoremove
rm -rf ~/.vnc

如果你告诉我:

  • Ubuntu 版本(如 20.04 / 22.04 / 24.04)
  • 桌面版还是服务器版
  • 用的是 哪个 VNC 客户端连接

我可以给你最精简、最安全的卸载方案

0