I installed kubuntu-desktop using sudo apt-get install kubuntu-desktop but I no longer want to use KDE.
How do I remove all the packages that were installed by this command ?
You could use apt-rdepends to find all the packages that have been installed by the kubuntu-desktop meta package and use the list as the input to apt-get purge. Possibly purging kdelibs* should be sufficient.
Another possibility would be to remove Qt (i.e. libqt4*), since KDE ist dependent on qt it will remove all KDE packages. However, this does not work very well if other Qt applications are used on the other desktop.
However, in any case, inspect the packages that apt-get wants to remove very carefully, since potentially the whole installation could be messed up by something like this.
1) Choose the method corresponding to your ubuntu version
2) Check which programs from the KDE environment you would like to keep because you need it and a) remove it from the removal list (with dependencies) or b) leave it in the list and reinstall it later.
3) Copy/past the command The command is as stated in this webpage and depends on your version, but generally looks like :
The command will not remove configuration files anyway, only the programs. If you want to also remove the config files, you will add the --purge option to the command.
Warning: The list of packages below is for a plain default install of Ubuntu with Kubuntu. You may want to keep some of the below packages and you should review what apt is going to remove before accepting.
These removal commands were created based on what Kubuntu, Xubuntu, etc. packages were added to a default Ubuntu installation. It's possible that the commands might remove some other packages you have since added to the default and want to keep. If that's the case, keep track of which packages those are and reinstall them. Your settings should still be there.
As always,backup your partition before modifying it.