How to Install Xfce Desktop on AlmaLinux 9
If you’re running AlmaLinux 9 on a laptop with 2‑4 GB of RAM or an old machine that chokes under GNOME, Xfce gives you the same familiar desktop feel without the bloated resource drain. In this quick guide you’ll learn how to add it in just a handful of steps and why each one matters.
Prerequisites: Check Your System
Before we dive in, make sure your system is up‑to‑date and you’re logged in as root or a user with sudo privileges. Outdated packages can cause the repository metadata to misbehave, leading to failed installs that leave you with an unusable desktop.
Step 1: Update Everything
sudo dnf update -y
Running a full update pulls the latest security patches and ensures the EPEL (Extra Packages for Enterprise Linux) repo can resolve dependencies properly. I’ve seen cases where an old kernel caused Xfce to freeze on login because of a mismatched graphics driver.
Step 2: Enable the EPEL Repository
sudo dnf install -y epel-release
EPEL houses many community‑maintained packages that RHEL‑based systems don’t ship by default. Xfce comes from there, so without it you’ll hit a “no such package” error.
Step 3: Install the Xfce Desktop Group
sudo dnf groupinstall -y "Xfce"
The groupinstall command pulls all the core components of Xfce—panel, window manager, file manager—into one cohesive stack. Skipping this step and installing individual packages is a pain; just grab the whole group and you’re good.
Step 4: Install LightDM (or an Alternative Display Manager)
sudo dnf install -y lightdm
Xfce doesn’t ship with its own display manager, so we need one. LightDM is lightweight, configurable, and works well on AlmaLinux. If you already have GDM or another DM, you can skip this or remove it to avoid conflicts.
Step 5: Configure the System to Use LightDM
sudo systemctl enable --now lightdm.service
Enabling LightDM as the default display manager ensures that when your machine boots, the Xfce login screen appears instead of GNOME’s. If you ever need to switch back, just disable it with systemctl disable --now gdm and re‑enable LightDM.
Step 6: Reboot
sudo reboot
A fresh boot lets the new display manager load its configuration and start the Xfce session automatically. When you log in, you’ll notice a far slimmer task bar and less memory consumption—a real relief if you’re juggling multiple tabs on a low‑end laptop.
Post‑Installation: Tweaks You Might Want
- Turn off compositor – Xfce’s default compositing can still eat RAM on older GPUs. Go to Settings => Window Manager Tweaks => Compositor and uncheck “Enable display compositing.”
- Add the ‘Xfce Extras’ group if you want extra goodies like an image viewer or a terminal emulator: sudo dnf groupinstall -y "Xfce Extras".
- Keep your system lean – Periodically run sudo dnf autoremove to clean up orphaned packages that came with the desktop but aren’t needed.
A Real‑World Scenario
I once upgraded a 8‑year‑old server from CentOS 7 to AlmaLinux 9 for a small website. The default GNOME session tried to load an insane amount of graphics drivers and crashed every few minutes on low‑memory spikes. Switching to Xfce not only stabilized the system but also cut memory usage by almost half, letting the machine handle web traffic without hiccups.
Enjoy your new lightweight desktop, and keep those updates coming—no more “I’ll fix it later” excuses!