How to remove the Ubuntu Gnome desktop after making the switch to KDE?

The purge command is a good start. In addition, you probably want to remove all the dependent libraries that were installed only to get Gnome. You can do that via autoremove in apt-get or, if you use aptitude, it should happen automatically.

Note that the purge command has an oddity: it purges items you remove explicitly, but only removes any automatically removed dependent packages. (That is, if you enter aptitude purge foo-bar and fizzbuzz gets automatically removed at the same time, foo-bar is purged but fizzbuzz is only removed.) So a good way to recursively purge is this:

aptitude purge foo-bar && aptitude purge ~c

The ~c search in aptitude finds any packages that were removed but not purged in the first removal.

One final note, if you haven't been using aptitude, always check its output the first time you try to run it. Don't simply say "Yes" to whatever it wants to do. Depending on what package manager you've been using, you may find that aptitude thinks some things should be autoremoved, but you prefer to keep them.


Ubuntu has a built-in tool for changing the type of system you are running.

$ sudo tasksel

This tool lets you check the box next to the type of system you want (Kubuntu, Xubuntu, Ubuntu, Ubuntu Server) and then confirm to have the tool re-configure your system, removing and adding packages as needed.


I think the simplest way to do this is to remove ubuntu-desktop and install kubuntu-desktop.

sudo apt-get install kubuntu-desktop
sudo apt-get --purge remove ubuntu-desktop

You can also just uninstall gnome-desktop-environment instead of ubuntu-desktop.