How to remove all traces of KDE installed

I have 2 computers with Ubuntu but on both I installed KDE to have another option for the users. Since Unity has come along very well, there has not been a need to use KDE for a while now. How can I delete all KDE related packages with one single sweep, freeing space and anything KDE related in Ubuntu, including overwriting the Logo of ubuntu when the PCs start or shutdown since after installing KDE the Kubuntu logo is the default one. How to revert back completely from all KDE stuff with a simple short command line or GUI tool.

NOTE - I ask this because it is very time consuming to start selecting, one by one, each package that relates to the KDE desktop environment, checking if it also relates to any GTK, checking dependencies for each, etc.. Deleting the package kubuntu-desktop does not remove every installed KDE package that was installed with it since this is a pseudo package that installs the rest of the real packages but does not uninstall them which makes me wonder why a package can install a whole bunch of other packages but not uninstall them with some added option to actually uninstall them not just the dummy package itself.


Solution 1:

I rather liked the simplicity of the following remove:

apt-get remove kdelibs-bin kdelibs5-data 

Credit to craigevil on the Debian Forums. (http://forums.debian.net/viewtopic.php?f=10&t=102884)

The thing here is that, by focusing on the two packages on which virtually all of KDE is built, the rest of KDE gets uninstalled too, as they depend on the above.

Solution 2:

You can use this command (from here) to remove KDE completely:

sudo apt-get remove akonadi-backend-mysql akonadi-server akregator amarok amarok-common amarok-utils apport-kde apturl-kde ark bluedevil cdparanoia cdrdao docbook-xsl dolphin dragonplayer freespacenotifier gnupg-agent gnupg2 gpgsm gstreamer0.10-qapt gtk2-engines-oxygen gwenview ibus-qt4 icoutils jockey-kde k3b k3b-data kaccessible kaddressbook kamera kate kate-data katepart kcalc kde-baseapps-bin kde-baseapps-data kde-config-gtk kde-config-touchpad kde-runtime kde-runtime-data kde-wallpapers-default kde-window-manager kde-workspace kde-workspace-bin kde-workspace-data kde-workspace-kgreet-plugins kde-zeroconf kdebase-runtime kdegames-card-data kdegraphics-strigi-analyzer kdelibs-bin kdelibs5-data kdelibs5-plugins kdemultimedia-kio-plugins kdenetwork-filesharing kdepasswd kdepim-groupware kdepim-kresources kdepim-runtime kdepim-strigi-plugins kdepim-wizards kdepimlibs-kio-plugins kdesudo kdm kdoctools kfind khelpcenter4 kinfocenter klipper kmag kmail kmix kmousetool knotes konsole kontact kopete kopete-message-indicator korganizer kpat kppp ksnapshot ksysguard ksysguardd ksystemlog ktimetracker ktorrent ktorrent-data kubuntu-debug-installer kubuntu-default-settings kubuntu-desktop kubuntu-docs kubuntu-firefox-installer kubuntu-netbook-default-settings kubuntu-notification-helper kubuntu-web-shortcuts kvkbd kwalletmanager language-selector-kde libakonadi-calendar4 libakonadi-contact4 libakonadi-kabc4 libakonadi-kcal4 libakonadi-kde4 libakonadi-kmime4 libakonadiprotocolinternals1 libassuan0 libattica0 libbluedevil1 libboost-program-options1.46.1 libcalendarsupport4 libcln6 libclucene0ldbl libdebconf-kde0 libdiscid0 libdlrestrictions1 libdmtx0a libencode-locale-perl libepub0 libeventviews4 libfile-listing-perl libflac++6 libfont-afm-perl libgadu3 libgpgme++2 libgps19 libgrantlee-core0 libhtml-form-perl libhtml-format-perl libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl libhttp-cookies-perl libhttp-daemon-perl libhttp-date-perl libhttp-message-perl libhttp-negotiate-perl libibus-qt1 libilmbase6 libincidenceeditorsng4 libindicate-qt1 libio-socket-ssl-perl libiodbc2 libk3b6 libkabc4 libkateinterfaces4 libkatepartinterfaces4 libkblog4 libkcal4 libkcalcore4 libkcalutils4 libkcddb4 libkcmutils4 libkde3support4 libkdecorations4 libkdecore5 libkdegames5a libkdepim4 libkdepimdbusinterfaces4 libkdesu5 libkdeui5 libkdewebkit5 libkdgantt2 libkdnssd4 libkemoticons4 libkephal4abi1 libkexiv2-10 libkexiv2-data libkfile4 libkholidays4 libkhtml5 libkidletime4 libkimap4 libkio5 libkipi-data libkipi8 libkjsapi4 libkjsembed4 libkldap4 libkleo4 libkmanagesieve4 libkmbox4 libkmediaplayer4 libkmime4 libknewstuff2-4 libknewstuff3-4 libknotifyconfig4 libkntlm4 libkonq-common libkonq5-templates libkonq5abi1 libkontactinterface4 libkopete4 libkparts4 libkpgp4 libkpimidentities4 libkpimtextedit4 libkpimutils4 libkprintutils4 libkpty4 libkresources4 libkrosscore4 libksba8 libkscreensaver5 libksgrd4 libksieve4 libksieveui4 libksignalplotter4 libktexteditor4 libktnef4 libktorrent-l10n libktorrent3 libkunitconversion4 libkwineffects1abi2 libkworkspace4 libkxmlrpcclient4 liblastfm0 libloudmouth1-0 liblwp-mediatypes-perl liblwp-protocol-https-perl libmailcommon4 libmailtools-perl libmailtransport4 libmessagecomposer4 libmessagecore4 libmessagelist4 libmessageviewer4 libmicroblog4 libmpcdec6 libmsn0.3 libmuonprivate1 libmusicbrainz3-6 libnepomuk4 libnepomukquery4a libnepomukutils4 libnet-http-perl libnet-ssleay-perl libntrack-qt4-1 libntrack0 libokularcore1 libopenexr6 libotr2 libphonon4 libplasma-geolocation-interface4 libplasma3 libplasmaclock4abi2 libplasmagenericshell4 libpolkit-qt-1-1 libpoppler-qt4-3 libprison0 libprocesscore4abi1 libprocessui4a libqalculate5 libqapt-runtime libqapt1 libqca2 libqca2-plugin-ossl libqgpgme1 libqimageblitz4 libqjson0 libqrencode3 libqt4-designer libqt4-help libqt4-qt3support libqt4-scripttools libqt4-sql-sqlite libqt4-test libqtassistantclient4 libqtglib-2.0-0 libqtgstreamer-0.10-0 libqtscript4-core libqtscript4-gui libqtscript4-network libqtscript4-sql libqtscript4-uitools libqtscript4-xml libqtwebkit4 libreoffice-kde libreoffice-style-oxygen libsolid4 libsolidcontrol4abi2 libsolidcontrolifaces4abi2 libsoprano4 libssh-4 libstreamanalyzer0 libstreams0 libsyndication4 libtag-extras1 libtaskmanager4abi2 libtemplateparser4 libthreadweaver4 libtimedate-perl liburi-perl libvirtodbc0 libweather-ion6 libwww-perl libwww-robotrules-perl libxml2-utils libxss1 libzip1 muon muon-installer muon-notifier muon-updater mysql-client-core-5.1 mysql-server-core-5.1 ntrack-module-libnl-0 odbcinst odbcinst1debian2 okular okular-extra-backends oxygen-cursor-theme oxygen-icon-theme oxygen-icon-theme-complete partitionmanager phonon phonon-backend-gstreamer pinentry-gtk2 pinentry-qt4 plasma-dataengines-addons plasma-dataengines-workspace plasma-desktop plasma-netbook plasma-scriptengine-javascript plasma-scriptengine-python plasma-widget-facebook plasma-widget-folderview plasma-widget-kimpanel plasma-widget-kimpanel-backend-ibus plasma-widget-menubar plasma-widget-message-indicator plasma-widget-networkmanagement plasma-widgets-addons plasma-widgets-workspace plymouth-theme-kubuntu-logo plymouth-theme-kubuntu-text printer-applet python-kde4 python-pyudev python-qt4 python-qt4-dbus python-sip qapt-batch qapt-deb-installer quassel quassel-data rekonq shared-desktop-ontologies software-properties-kde soprano-daemon system-config-printer-kde systemsettings update-manager-kde usb-creator-kde userconfig virtuoso-minimal virtuoso-opensource-6.1-bin virtuoso-opensource-6.1-common && sudo apt-get install ubuntu-desktop

However, if you have manually installed KDE-specific programs since installing KDE, then you'll have to remove those programs separately and then run sudo apt-get autoremove.

Warning: As Munim says, this will remove a lot of packages, and may remove packages that were installed before KDE (or after KDE but separately from it) as well as packages that were installed as part of KDE. This may occasionally produce unpredictable results, such as package configuration problems.


syserss has written an explanation of some of the further action you may need to take to make your system work the way you wish after removing these packages.

(I've quoted it below, but changed the citation format to embedded links, for readability.)

The steps above will remove all of the KDE software, but it won't necessarily restore your system back to pre-KDE install state. There are two additional steps that I had to do to restore my system to pre-installation of kubuntu-desktop.

The first was to modify the Plymouth configuration to remove the "Kubuntu" splash screen (this is just cosmetic, but still annoying and unclean, documented in Ubuntu shows 'Kubuntu' on boot):

sudo update-alternatives --config default.plymouth
sudo update-initramfs -u

And the second was to restore the lightdm configruation to use the unity-greeter instead of kde-plasma-greeter. First run this command to open the lightdm configuration page - sudo gedit /etc/lightdm/lightdm.conf and then edit / replace these lines:

greeter-session=unity-greeter
user-session=ubuntu

This last step I cobbled together from KDE overrides lightdm logon screen and How to return the login screen of the original unity ubuntu?.

Solution 3:

This post is probably too late. However, as nothing else was working for me (I was using KDE5), I tried the following and it did the trick:

sudo apt remove libkf5* (bash)

sudo apt remove 'libkf5*' (zsh)

Then, use sudo apt autoremove to remove all the unused packages

Solution 4:

If you are using ubuntu 15.10 or previous version then this command is helpful:

sudo apt-get remove kubuntu

If you are using Ubuntu 16.04 and Plasma 5 then follow the following step

sudo apt purge kubuntu-desktop
sudo apt autoremove
sudo add-apt-repository --remove ppa:kubuntu-ppa/backports