Installing the XFCE desktop environment on RHEL-based distributions like Rocky Linux and AlmaLinux allows you to have a lightweight, fast, and customizable graphical user interface. XFCE is ideal for users who want a full desktop experience without the resource overhead of heavier environments like GNOME or KDE. This guide walks you through the process of installing XFCE step-by-step, ensuring you can easily switch to or add XFCE on your server or desktop system.
What You’ll Need
- A running installation of Rocky Linux or AlmaLinux with root or sudo privileges
- An active internet connection to download packages from the repositories
- Basic familiarity with command line interface (CLI)
Step-by-Step
- Update Your System
Before installing new software, update your system packages to the latest versions for security and compatibility:sudo dnf update -y - Install EPEL Repository
XFCE packages are available through the Extra Packages for Enterprise Linux (EPEL) repository, which you need to enable first:sudo dnf install epel-release -y
Confirm the repository is enabled:sudo dnf repolist | grep epel - Install the XFCE Desktop Group
Rocky Linux and AlmaLinux use DNF groups to install desktop environments. Install the XFCE group as follows:sudo dnf groupinstall "Xfce Desktop" -y
This will install the XFCE desktop environment along with required dependencies and basic utilities. - Install a Display Manager
To graphically log in to XFCE, you need a display manager. LightDM is a popular choice for XFCE due to its simplicity:sudo dnf install lightdm lightdm-gtk
Enable LightDM to start on boot:sudo systemctl enable lightdm.service --force - Disable the Default Display Manager (if applicable)
If another display manager like GDM is running, disable it to avoid conflicts:sudo systemctl disable gdm.service
and stop it immediately:sudo systemctl stop gdm.service - Set Default Target to Graphical
Ensure your system boots into graphical mode:sudo systemctl set-default graphical.target - Reboot Your System
Restart your machine to load the new desktop environment and display manager:sudo reboot - Log in to XFCE
Once rebooted, the LightDM login screen should appear. Select XFCE as your session if prompted, then log in with your user credentials. - Customize XFCE (Optional)
After logging in, you can customize XFCE using the Settings Manager for themes, panel layouts, and other preferences.
Common Mistakes
- Not enabling EPEL repository: XFCE packages are not part of the default repos; forgetting this step will cause installation errors.
- Skipping display manager setup: Without a display manager like LightDM, the system won’t present a graphical login screen.
- Not disabling conflicting display managers: Having multiple active display managers can cause login issues or black screens.
- Not setting graphical target: If the default target remains multi-user.target, you’ll boot into a command line interface only.
- Using wrong group name or spelling: The group name must be exact: “Xfce Desktop” (case-sensitive).
Tips
- Use sudo carefully: Most commands require root privileges; ensure you have sudo access or are logged in as root.
- Check available desktop groups: Run
sudo dnf grouplistto see all installable environment groups. - Install additional XFCE goodies: For extra utilities, consider installing
xfce4-goodiespackage:sudo dnf install xfce4-goodies -y - Customize LightDM: You can tweak LightDM’s greeter themes and settings by editing files in
/etc/lightdm/. - Use minimal install as base: XFCE works well on minimal server installs, making it ideal for lightweight desktop setups.
- Keep system updated: Regularly run
sudo dnf updateto maintain security and stability.
Troubleshooting
- Black screen after reboot: Confirm LightDM is enabled and running:
sudo systemctl status lightdm
If inactive, start it manually:sudo systemctl start lightdm - Cannot log in graphically: Check for errors in LightDM logs:
cat /var/log/lightdm/lightdm.log
Ensure XFCE session files exist in/usr/share/xsessions/. - XFCE session not listed: Sometimes the session might not appear. Verify XFCE is installed correctly and try logging in from the command line with:
startx
after setting~/.xinitrcto start XFCE:echo "exec startxfce4" > ~/.xinitrc - Dependency or package errors: Make sure EPEL repo is enabled and your system is up to date. Clear dnf cache if needed:
sudo dnf clean all - Multiple display managers conflict: Disable all except one display manager:
sudo systemctl disable gdm && sudo systemctl enable lightdm
Frequently Asked Questions
Can I install XFCE alongside GNOME or KDE?
Yes, you can have multiple desktop environments installed. At login, choose which session to start. However, be mindful of disk space and possible configuration overlaps.
Is XFCE suitable for servers?
XFCE is lightweight and can be used on servers that require a GUI, but generally servers run headless for performance and security reasons.
How do I switch back to the default desktop environment?
At the login screen, select the session dropdown or gear icon to choose another installed desktop environment before logging in.
Why is the “Xfce Desktop” group not found?
This usually means the EPEL repository is not enabled or your DNF metadata is outdated. Run sudo dnf install epel-release and sudo dnf clean all before retrying.
Can I use a different display manager with XFCE?
Yes, besides LightDM, you can use GDM, SDDM, or others, but LightDM is recommended for simplicity and XFCE compatibility.
How do I uninstall XFCE if I no longer want it?
Use sudo dnf groupremove "Xfce Desktop" to remove the desktop environment and its packages, then disable LightDM if it was installed.
By following this guide, you can successfully install and run the XFCE desktop environment on Rocky Linux or AlmaLinux, providing a fast and efficient GUI tailored to your needs.
Related
- How to Ripen Figs Quickly and Safely for Kids to Eat
- How to Ripen Figs in the Refrigerator for Perfect Sweetness
- How to Ripen Figs When They Are Hard: A Step-by-Step Guide