I wanted a window manager, so I installed xfce4. I used

sudo apt-get install xfce4

to do this. To remove it, I used

sudo apt-get remove --purge xfce4  

which didn't work, and neither did

sudo dpkg purge xfce4

as evidenced 1) startx launches the xfce desktop, and 2) apt-cache search xfce4 returns a long list of installed packages.

So, how can I get rid of xfce4 and it's dependencies?

  • apt-cache search doesn't just show what packages are installed. It also show what packages can be installed in the future. May 13, 2015 at 6:19

6 Answers 6


xfce4 itself is a meta-package that will install a default configured xfce desktop environment.

In most cases the base files that comes with xfce4 are: xfconf, xfce4-utils, xfwm4, xfce4-session, thunar, xfdesktop4, exo-utils

So you can do

sudo apt-get purge xfconf xfce4-utils xfwm4 xfce4-session thunar xfdesktop4 exo-utils xfce4-panel xfce4-terminal

Then most of the package that were associated with these package become autoremovable so you can run

sudo apt-get autoremove

or, almost all xfce4 package depend upon libxfce4util-common. Just purge that one and you remove everything related to xfce


Note that apt-cache is not showing you installed packages, but rather those which are known about.

To test what you have installed, you might like to use:

dpkg --get-selections | grep xfce

Be sure to look at the second output column to see whether it's installed or deinstalled.

After purging all xfce packages, the above command returns no output on my machine.


Aptitude can do this by using package search ~n and using -P to prompt when adding or removing packages.

sudo aptitude -P remove ~nxfce4

Substitute remove with purge if you would like to remove the system configuration files:

sudo aptitude -P purge ~nxfce4

To remove user config files (use -r with care - recursive delete!!):

sudo rm -r ~/.config/xfce4
  • Worthy to mention that cleaned up all xfce4 trace just leaving gtk2-engines-xfce & xfce-keyboard-shortcuts on Raspbian Jessie Lite
    – Denja
    Mar 16, 2016 at 3:21
sudo aptitude purge xfce4 desktop-base exo-utils gtk2-engines-xfce libexo-1-0 libexo-common libgarcon-1-0 libgarcon-common libthunarx-2-0 libtumbler-1-0 libxfce4ui-1-0 libxfce4util-bin libxfce4util-common libxfce4util4 libxfconf-0-2 orage tango-icon-theme thunar thunar-data thunar-volman tumbler tumbler-common xfce-keyboard-shortcuts xfce4 xfce4-appfinder xfce4-mixer xfce4-panel xfce4-session xfce4-settings xfce4-utils xfconf xfdesktop4 xfdesktop4-data xfwm4 xfwm4-themes

Will remove everything related with xfce4 in your computer. You will need to install aptitude first if you haven't:

sudo apt-get install aptitude

I think you should try aptitude.

Install it: sudo apt-get install aptitude

Maybe you will have first to install again xfce4: sudo aptitude install xfce4

Now purge it: sudo aptitude purge xfce4

ps.: I've never installed xfce4 but the command apt-cache search xfce4 also gives me this output.

  • thanks for the advice, but startx still launches xfce Sep 2, 2011 at 19:27

Try this: Type 'sudo apt-get remove --purge xfce4. Yes, you've akready done this, but a few extra seconds involved won't hurt... much.

Then type 'find xfce4' (as rarely, if ever, everything IS actually removed)

Then manually delete anything found.

Then type 'sudo apt-get clean && sudo apt-get autoremove, this, in most cases removes any no longer needed dependencies.

For some reason Ubuntu expecting that you will at some future point reinstall a program, it leaves behind some of the configuration files, which in many cases causes problems later.

This is the quickest way that I know of, there are indubitably better ways available, but this method works for me, which, is all that matters.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.