Ubuntu 20.04: Install Xfce for desktop environment

This article will describe installing Xfce for desktop environment.

1 Install Xfce

#!/bin/sh -e

cat <<EOF | sudo tee /etc/X11/default-display-manager
/usr/sbin/lightdm
EOF
sudo DEBIAN_FRONTEND=noninteractive apt install -y xubuntu-desktop
sudo reboot

2 Login to Xfce

After reboot, lightdm-gtk-greeter will be started. You can select other desktop environment.

0001_lightdm.png

Xfce is displayed.

0002_xfce.png

3 Uninstall Xfce

#!/bin/sh -e

sudo apt remove -y xubuntu-desktop xfdesktop4 xfce4-* libxfce4* \
     lightdm
sudo apt autoremove -y
sudo apt install --reinstall -y gdm3
sudo reboot