Arch Linux

Install XFCE 4 Desktop Environment on Arch Linux

There are many desktop environments on Linux. For example, KDE Plasma 5, GNOME 3, GNOME 4x (i.e. GNOME 40, GNOME 41, GNOME 42), MATE, Cinnamon, LXDE, Budgie, and Cutefish. XFCE desktop environment is one of them. Just like LXDE and MATE, the XFCE desktop environment is one of the lightweight desktop environments out there. It doesn’t consume a lot of memory, doesn’t need much CPU power, or disk I/O to run. It is also more responsive compared to other desktop environments, such as GNOME3, KDE Plasma 5, and Cinnamon. If you want to just get your work done and you don’t care about fancy desktop effects and transparency, you should try out the XFCE desktop environment.

XFCE 4 is the latest version of the XFCE desktop environment at the time of this writing. In this article, I will show you how to install the XFCE 4 desktop environment on Arch Linux. So, let’s get started.

Table of Contents:

  1. Updating All Packages
  2. Creating a New User
  3. Configuring sudo for Newly Created User
  4. Installing the XFCE 4 Desktop Environment
  5. Installing a Display Manager
  6. Login to the XFCE4 Desktop
  7. Conclusion
  8. References

Updating All Packages:

Before you install the XFCE 4 desktop environment, it’s a good idea to update all the installed packages of your Arch Linux computer.

To update all the installed packages of Arch Linux, run the following command:

$ pacman -Syu

In my case, all the installed packages are up-to-date:

If you have any updates, you can press Y, and then press <Enter> to confirm the installation of updates.

Creating a New User:

Arch Linux does not create an ordinary user by default when you install Arch Linux on your computer. I highly recommend not running a graphical user interface as the root user.

So, create a new user <username> with the following command:

$ useradd -m <username>

NOTE: In my case, <username> is shovon. Make sure to replace <username> with your desired username from now on:

To set a password for the newly created user <username>, run the following command:

$ passwd <username>

Type in your desired login password and press <Enter>.

Type in your desired login password again and press <Enter>.

Your desired login password should be set:

Configuring sudo for Newly Created User:

Even when using an ordinary user, you will still need superuser privileges to run administrative commands. So, you should configure your user with sudo. This way, the user can run commands with superuser privileges when needed.

To install sudo, run the following command:

$ pacman -S sudo

To confirm the installation, press Y and then press <Enter>.

sudo should be installed:

To configure sudo, run the following command to open the sudoers file with the nano text editor:

$ EDITOR=/usr/bin/nano visudo

NOTE: You may not have the nano text editor installed. In that case, you can install nano with the following command:

$ pacman -S nano

Find the marked line.

Remove the # sign from the beginning of the line to uncomment it. Once you’re done, press <Ctrl> + X followed by Y and <Enter> to save the sudoers file.

Now, add the newly created user <username> to the wheel group as follows:

$ usermod -aG wheel shovon

Next, you should be able to log in as your newly created user, as you can see in the screenshots below:

$ exit

You should be able to run commands with superuser privileges with sudo:

$ sudo ls

Installing the XFCE 4 Desktop Environment:

To install the XFCE 4 desktop environment, run the following command:

$ sudo pacman -S xfce4 xfce4-goodies

Press <Enter>.

Press <Enter>.

Press <Enter>.

To confirm the installation, press Y and then press <Enter>.

The Pacman package manager will download and install the XFCE 4 desktop environment and the required dependencies. It will take a while to complete.

At this point, the XFCE 4 desktop environment should be installed.

Now, set graphical.target as the default target as follows:

$ sudo systemctl set-default graphical.target

Installing a Display Manager:

Now that you have installed the XFCE 4 desktop environment, you will need a display manager installed. There are many display managers available for Linux. In this article, I will show you how to install the GDM display manager.

To install the gdm display manager, run the following command:

$ sudo pacman -S gdm

Press <Enter>.

Press Y and then press <Enter> to confirm the installation.

GDM and all the required dependency packages will be downloaded and installed. It will take a while to complete.

At this point GDM should be installed:

Add the gdm service to the system startup so that it automatically starts at boot time as follows:

$ sudo systemctl enable gdm

Reboot your computer with the following command:

$ sudo reboot

Log in to the XFCE 4 Desktop:

Once your computer boots, you will see the GDM login screen.

Click on the user that you want to log in as:

Click on the gear icon () and select Xfce Session as marked in the following screenshot:

Type in your login password and press <Enter>.

You should be logged in to the XFCE 4 desktop environment.

The following image shows the user interface of the XFCE 4 desktop environment:

Conclusion:

This article discussed creating a new ordinary user and configuring it with sudo on Arch Linux. Also, we focused on how to install XFCE 4 desktop environment and the GDM display manager on Arch Linux. We hope you found this article helpful. Check the other Linux Hint articles for more tips and information.

References:

[1] Xfce – ArchWiki (archlinux.org)

[2] GDM – ArchWiki (archlinux.org)

About the author

Shahriar Shovon

Freelancer & Linux System Administrator. Also loves Web API development with Node.js and JavaScript. I was born in Bangladesh. I am currently studying Electronics and Communication Engineering at Khulna University of Engineering & Technology (KUET), one of the demanding public engineering universities of Bangladesh.