老规矩,直接上干货
安装软件,vnc远程桌面只支持xfce
sudo apt update
sudo apt -y install xfce4 xfce4-goodies echo "========================================"
echo "Installing TigerVNC Server..."
echo "========================================"sudo apt -y install tigervnc-standalone-server tigervnc-xorg-extension dbus-x11 xauth xterm
启动
tigervncserver :1 -localhost no -geometry 1920x1080 -depth 24 -xstartup /usr/bin/startxfce4
xfce 远程桌面无法使用desktop snap安装的应用,需要改成apt安装
例如卸载firefox安装,以下写到install.sh
脚本运行
if snap list | grep -q firefox; thenecho "⚠️ 检测到 snap 版 Firefox,正在卸载..."sudo snap remove firefox
fi
echo "=== 安装 Firefox (deb 版) ==="
# 添加官方 PPA(非交互)
sudo add-apt-repository -y ppa:mozillateam/ppa
sudo apt-get update
# 强制使用 deb 包,避免 snap 版本
echo 'Package: firefox*' | sudo tee /etc/apt/preferences.d/firefox.pref
echo 'Pin: release o=LP-PPA-mozillateam' | sudo tee -a /etc/apt/preferences.d/firefox.pref
echo 'Pin-Priority: 1001' | sudo tee -a /etc/apt/preferences.d/firefox.pref
sudo apt-get install -y firefox