Xfce is a lightweight free, open-source desktop environment for UNIX-like operating systems. It is designed to be fast and light on system resources while visually appealing to the default desktop environments that ship with most operating systems. Xfce is very popular with older systems, with hardware as a key feature in its design to conserve memory and CPU cycles. For example, the desktop panel will not hog resources by constantly polling for changes, and the file manager has been designed to use minimal memory and CPU cycles. In addition, Xfce includes several power management features that can help reduce your carbon footprint. Overall, Xfce is an excellent choice for users who want a fast and stable desktop environment without sacrificing visual appeal or functionality.
In the following tutorial, you will learn how to install Xfce on your CentOS 9 Stream desktop using the command line terminal, along with some basic tips on running an update and removing the Xfce desktop environment.
Table of Contents
Update CentOS Stream
First, ensure your system is up-to-date using the following command.
sudo dnf upgrade --refresh
Import EPEL Repository
The first task is to install the (EPEL) repository, which stands for (Extra Packages for Enterprise Linux). For newer users of CentOS Stream and similar distributions based on RHEL, EPEL contains the most commonly used software packages for Enterprise Linux.
First, enable the CRB.
sudo dnf config-manager --set-enabled crb
Next, install EPEL using the following (dnf) terminal command.
sudo dnf install \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm
Install Xfce on CentOS
With the repositories, you can now begin installing the alternative desktop.
First, in your terminal, make sure Xfce is available.
sudo dnf group list
Example output:
Now proceed to install the Xfce desktop with Xorg.
sudo dnf groupinstall "Xfce" "base-x"
The installation should not take long. On older hardware and limited internet, it can take several minutes.
Next, set the default target system to graphical using the command below.
echo "exec /usr/bin/xfce4-session" >> ~/.xinitrc
Users installing Xfce from a headless environment enable the GUI on the restart.
sudo systemctl set-default graphical
Once complete, reboot your system.
reboot
Login to Xfce Desktop
Once you have restarted your desktop, you will arrive at your login screen.
DO NOT LOG IN STRAIGHT AWAY.
First, you need to verify the desktop environment. This is done by clicking the configuration button next to the sign-in button.
Next, select “Xfce Session” instead of the default “Standard.”
Example (Click Image Expand):
Once logged in, you will notice quite a few UI changes besides the apparent color and background changes similar to Fedora, as that is what it is based on as it all flows down. The taskbar is now similar to a more windows type of taskbar, along with more integrations in the top left-hand and right-hand corner of services where the time display is, but this can be customized to your look.
Example (Click Image Expand):
Optionally, you confirm the installation with Neofetch, which comes in the EPEL repository you installed earlier.
Install this package using the following command in your terminal.
sudo dnf install neofetch -y
Once installed, run the following command in your terminal.
neofetch
Example output (Click Image Expand):
And that is it, and you have successfully installed the Xfce desktop environment.
How to Update Xfce Desktop Packages
Run the standard dnf upgrade command for future updates for the Xfce desktop environment and any default packages from the App Stream.
sudo dnf upgrade --refresh
When updates are available, it is the same process to upgrade.
How to Remove Xfce Desktop
Users not wishing to use the desktop environment use the following command to remove Xfce.
sudo dnf groupremove "Xfce" "base-x"
Note, that running the distro-sync command can help users that encounter any issues.
sudo distro-sync
Now reboot your system.
reboot
When you reach the login screen, you will be reverted to your previous settings, login, and your original desktop environment, such as GNOME, will be shown.
Comments and Conclusion
If you are looking for an alternative to the heavier desktop environments that come pre-installed on most operating systems, or if you want to try something different to speed up your older system, give Xfce a try. It is lightweight and visually appealing while still being fast and easy on system resources.