One of the various ways to speed up Ubuntu is to use a lightweight desktop environment as it consumes fewer system resources. If you weren’t sure which Ubuntu to use and opted for the default Ubuntu, you may feel like using another desktop environment that better suits your need.
The good thing about Linux is that you can install another desktop environment (DE) along with your current one. You can easily switch between the two DEs at the login time. And why just two DEs? You can have more than two desktop environments as well.
You can also opt for completely removing one desktop and stay with the other one. It’s totally up to you.
Most of the time, the desktop environments don’t conflict. But if you see something amiss or out of place, such as network manager missing or something similar, you can remove the conflicting new desktop or reinstall the existing one.
This tutorial is about using Xfce desktop on your Ubuntu Unity or GNOME or any other Ubuntu flavor except Xubuntu.
Installing Xfce on Ubuntu
I have noticed that most tutorials on the internet just tell you how to install Xfce on Ubuntu but they don’t discuss how to remove it. This is important because if you don’t remove it completely, it will leave traces of the removed desktop behind. This will spoil your pristine desktop experience. This is why I have added the removal of Xfce desktop in this tutorial.
Let’s first begin with understanding Xfce and Xubuntu.
Difference between Xfce and Xubuntu
There are two ways you can use Xfce desktop on Ubuntu. Either you just install the Xfce desktop (xfce4 package) or you install the Xubuntu desktop (xubuntu-package).
What is the difference between xfce4 and xubuntu-desktop packages? Installing Xfce on Ubuntu will turn it into Xubuntu, won’t it?
If you install the xfce4 package, you just get the Xfce desktop and some basic packages included in the Xfce desktop such as Thunar file manager. The rest of the things remain the same. For example, if you use a terminal, it will still be the GNOME terminal.
However, if you choose to install the xubuntu-package, it will have Xfce desktop, all the packages in xfce4 and additional packages that are provided by Xubuntu distribution. You’ll have Xubuntu’s own terminal instead of GNOME terminal. You’ll see Xubuntu wallpaper at boot time (Plymouth) even when you are not using the Xubuntu session.
It will sort of change your current Ubuntu flavor to Xubuntu.
So, which one should you use? xfce4 or xubuntu-desktop?
The answer depends on your need. If you just want to experience Xfce desktop and don’t care for an aesthetic experience with Xfce, you can use xfce4.
But if you want the complete Xubuntu desktop experience as if you were using Xubuntu itself, go for xubuntu-desktop. You can also remove all traces of Unity to convert your Ubuntu install to Xubuntu.
Warning! Don’t install xfce4 and xubuntu-desktop both on the same system. There might be conflict as both would use the same Xfce session files. If you want to try out both, purge the one already installed.
Install Xfce desktop on Ubuntu using xfce4 package
That’s really simple. All you need to do is to open a terminal and use the command below:
sudo apt install xfce4
You can see the new packages that will be installed. It takes around 112 MB in size.
Once installed, restart your system (simple log out didn’t work for me in Ubuntu 17.10). At the login screen, click on the user first and then click the gear symbol and select Xfce session to login to use Xfce desktop.
You can use the same way to switch back to the default Ubuntu desktop environment by selecting Ubuntu Default.
At the first run, it will ask you to set config. You can opt for the default configuration.
Install Xfce desktop on Ubuntu using xubuntu-desktop
To get the actual Xubuntu experience, you can install xubuntu-desktop package that offers several applications of its own.
sudo apt install xubuntu-desktop
It will install files of size around 300 MB, an indication that there are more packages here than xfce4.
This process will ask you to choose the display manager as well. I chose gdm3.
Once installed, restart your system. At the login screen, click on the user first and then click the gear symbol and select Xubuntu session to login to use Xfce desktop.
You’ll also see Xfce session that gives you vanilla Xfce desktop session. If you are interested, learn some Xfce customization tips to make it look better.
Completely remove Unity to turn it into Xubuntu (for experts)
If you opted for Xubuntu desktop and you liked it so much that you would keep it as your main and only desktop, you may opt to remove Unity from your system.
I won’t advise it for everyone though. Not that it is extremely risky but if some crucial packages are removed, I believe that an expert Linux user won’t panic in fixing the messed up system.
Easy Linux Tips Project has created a list of packages that you can remove to clear your system of Unity traces.
Make sure that you have logged into Xubuntu session and then use the following command to remove all the packages associated with Unity.
sudo apt remove nautilus gnome-power-manager gnome-screensaver gnome-termina* gnome-pane* gnome-applet* gnome-bluetooth gnome-desktop* gnome-sessio* gnome-user* gnome-shell-common compiz compiz* unity unity* hud zeitgeist zeitgeist* python-zeitgeist libzeitgeist* activity-log-manager-common gnome-control-center gnome-screenshot overlay-scrollba* && sudo apt-get install xubuntu-community-wallpapers && sudo apt-get autoremove
You may have to install the Software Center afterwards:
sudo apt install gnome-software
Removing Xfce desktop and getting back your regular Ubuntu system
If you didn’t like Xfce, perhaps you would want to remove it. It is important to remove a few additional packages that get installed with it automatically but need manual removal.
Do make sure that you have not removed the default Ubuntu session. At the login, select the Ubuntu default session and log into it.
If you used xfce4 package, use the following commands to remove Xfce:
sudo apt purge xubuntu-icon-theme xfce4-* sudo apt autoremove
If you used xubuntu-desktop package to install Xfce, use the commands below:
sudo apt purge xubuntu-desktop xubuntu-icon-theme xfce4-* sudo apt purge plymouth-theme-xubuntu-logo plymouth-theme-xubuntu-text sudo apt autoremove
Make GRUB purple again (for intermediate to expert)
You’ll also notice that the color of your GRUB screen has been changed to black from the usual purple. This is because /boot/grub/grub.cfg file has been changed. The part that determines the color of the GRUB screen has been removed. You can add it back to get back the purple colored GRUB screen again.
Now, this involves editing the GRUB config file. Editing this file should be done with cautious. If you are not comfortable with command line, I say don’t care about the color of the GRUB screen.
For those who are comfortable with editing files in the command line, make a backup of the current GRUB configuration file:
cp /boot/grub/grub.cfg /boot/grub/grub.cfg.backup
And after that, use a command line text editor like Vim to edit the /boot/grub/grub.cfg file. Look for the lines that are between ### BEGIN /etc/grub.d/05_debian_theme ### and ### END /etc/grub.d/05_debian_theme ###. Add the color information to it. It should now look like this:
### BEGIN /etc/grub.d/05_debian_theme ### set menu_color_normal=white/black set menu_color_highlight=black/light-gray if background_color 44,0,30,0; then clear fi ### END /etc/grub.d/05_debian_theme ###
What do you think?
I hope this detailed tutorial not only helped you to install Xfce desktop on Ubuntu, but it also teaches you a few more things about installing additional desktop environments.
If you have some questions or tips to add, please feel free to use the comment section below.