Q:

How to remove unity and install XFCE4 for 16.04

I have installed standard ubuntu in a VM but it's running too slow. I would like to remove unity and install XFCE4 instead. I would also like to keep the extra applications like Libreoffice and so. 
What is the best way to do this?
I've found this old link (for 12.04) and also this site which show different commands so I don't know what to do. 

A:

I've done something similar, but for gnome-shell.
If you want to "convert" to a xubuntu, you should do:
sudo apt install xubuntu-desktop

Log out, change to the xfce-session in lightdm (by clicking on the icon, top icon to the right of your user) and log in.
Remove ubuntu-desktop meta package:
sudo apt purge ubuntu-desktop

If you only want to install xfce and remove unity, but keep the packages provided by ubuntu-desktop:
sudo apt install xfce4

Do the same log out/change session/log in procedure as noted above.
Remove unity:
sudo apt purge --autoremove unity unity8

