Ubuntu – How to completely remove kubuntu-desktop from Ubuntu


I installed kubuntu-desktop just to experiment with its interface.
Then I decided to remove and did the traditional apt-get purge and autoremove
but it seems elements of kubuntu are still there.
For example interface elements, scrollbars, bootscreen etc are still there.

Is there any method I can completely remove without installing a fresh copy of ubuntu?

Best Answer

I would recommend you to use aptitude to do this operation, this will search the packages that would remove the KDE environment and leave Ubuntu's default:

sudo apt-get install aptitude
aptitude search '?and(?and(?and(?reverse-depends(kubuntu),?not(?reverse-depends(ubuntu-desktop))),?automatic), ?not(?or(?priority(required), ?priority(important))))' ubuntu-desktop+

This will search for any package that kubuntu-desktop depends to, but doesn't depends of ubuntu-desktop. Also, this method is a bit greedy. It will remove Qt packages, ergo mplayer2, VLC and any package that depends on Qt libraries may be deleted. Add those packages with a plus sign (+) at the end, like ubuntu-desktop package in this case. For other flavors:


aptitude search '?and(?and(?and(?reverse-depends(kubuntu),?not(?reverse-depends(xubuntu-desktop))),?automatic), ?not(?or(?priority(required), ?priority(important))))' xubuntu-desktop+


aptitude search '?and(?and(?and(?reverse-depends(kubuntu),?not(?reverse-depends(lubuntu-desktop))),?automatic), ?not(?or(?priority(required), ?priority(important))))' lubuntu-desktop+


aptitude search '?and(?and(?and(?reverse-depends(kubuntu),?not(?reverse-depends(ubuntu-gnome-desktop))),?automatic), ?not(?or(?priority(required), ?priority(important))))' ubuntu-gnome-desktop+

As you can see, only replace the last packages name with the name of your preferred to leave. If you used kde-core or other metapackages you should replace "kubuntu" with the name of the metapackage.

Making sense of aptitude search

To explain exactly which package are selected, lets explain the search command more deeply:

        ?and(                          // we're searching for packages that are
            ?reverse-depends(kubuntu), // reverse dependencies of kubuntu
            ?not(?reverse-depends(ubuntu-desktop)) // and not of ubuntu-desktop
            ),     // that fulfills the condition above 
        ?automatic // and is automatically installed
     ?not(                        // and also that are not
         ?or(                     // either required nor important
Related Question