Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed Ubuntu Server 14.04 on my server this morning, I thought it would be cool to run a GUI. Though it occupies too much memory for my liking. How can I revert back to CLI, permanently? And also how can I remove KDE so it never existed?

I've tried sudo apt-get remove kubuntu-desktop && sudo apt-get remove autoclean but it's still there.

share|improve this question
Are you still able to boot the system? – Braiam May 2 '14 at 17:13
I've performed a fresh reinstall. The issue no longer exists, as I chose not to install the KDE package from the software list. – adampski May 2 '14 at 17:42

Through you reinstalled this is the safest method to remove kubuntu desktop package:

sudo apt-get install aptitude ubuntu-minimal
sudo aptitude remove '?and(?reverse-depends(kubuntu)),?not(?reverse-depends(?exact-name(ubuntu-minimal))))'

This will leave your system with the minimal installation of Ubuntu, enough to boot, without Kubuntu packages.

Explaining what aptitude does:

  • ?and(conditional1, conditional2): search for all packages that fulfill both conditions.
  • ?reverse-depends(package): search for all packages which reverse dependencies include the package package.
  • ?not(package): search for packages that doesn't fulfill this condition.
  • ?exact-name(package): when using ?name() it search for any package that contains the name, for example it will find package, libpackage0 and package-gui. With ?exact-name it specifies that it should be the exact name, is the equivalent to ^package$ regular expression.

If we were to interpret it in plain english: aptitude, remove any package that has reverse dependencies with a package that includes in it's name kubuntu, but that isn't reverse dependency of a package with the exact name of ubuntu-minimal.

share|improve this answer
Hi Braiam. Can you explain your second command with some more detail? Step by step maybe? If it works, this looks like an interesting answer and I learned something new. – don.joey May 3 '14 at 6:23
@don.joey if I have to say it with plain english it would be: aptitude, remove any package that has reverse dependencies with a package that includes in it's name kubuntu, but that isn't reverse dependency of a package with the exact name of ubuntu-minimal. – Braiam May 3 '14 at 12:24
Nice! Have an upvote. Maybe you can include it in the answer? – don.joey May 3 '14 at 13:23
@don.joey there. – Braiam May 3 '14 at 16:22

If you only just installed this morning, reinstall. That's the easiest way to get a perfectly clean slate (and it is a good exercise).

share|improve this answer
Whilst I would typically do this, I had already had a second install of it this morning and really didn't want to do it again. Nice suggestion, but didn't answer the question. – adampski May 2 '14 at 14:42
I understand that a reinstall is not always an option. I disagree that this is a suggestion and not an answer though. It might not be the answer you prefer, but it is an answer. Definitely for a server you should be sure it is absolutely as clean as possible both for security and performance. – don.joey May 2 '14 at 17:09
Granted. Ironically this is the action I ended up performing, anyway. – adampski May 2 '14 at 17:42

In terminal :

 sudo apt-get --purge remove kubuntu-desktop

--purge flag you are removing all configurations for that package

sudo apt-get autoremove

remove all orphaned packages that would have depended on the kubuntu-desktop

Reference Site

Or try this one :

sudo apt-get purge --auto-remove akonadi-backend-mysql akonadi-server docbook-xsl dolphin freespacenotifier gpsd  icoutils kate-data katepart kde-baseapps kde-baseapps-bin kde-baseapps-data  kde-plasma-desktop kde-runtime kde-runtime-data kde-style-oxygen  kde-wallpapers-default kde-window-manager kde-window-manager-common  kde-workspace kde-workspace-bin kde-workspace-data kde-workspace-kgreet-plugins  kdelibs-bin kdelibs5-data kdelibs5-plugins kdepasswd kdepim-runtime  kdepimlibs-kio-plugins kdm kdoctools kfind kinfocenter klipper kmenuedit  konqueror konqueror-nsplugins konsole ksysguard ksysguardd  kubuntu-debug-installer kwrite libakonadi-calendar4 libakonadi-contact4  libakonadi-kabc4 libakonadi-kcal4 libakonadi-kde4 libakonadi-kmime4  libakonadi-notes4 libakonadiprotocolinternals1 libattica0.3  libboost-program-options1.46.1 libcln6 libclucene0ldbl libdlrestrictions1  libdmtx0a libencode-locale-perl libfile-listing-perl libfont-afm-perl libgps20  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 libilmbase6 libio-socket-inet6-perl  libio-socket-ssl-perl libkabc4 libkactivities-bin libkactivities6 libkalarmcal2  libkatepartinterfaces4 libkcal4 libkcalcore4 libkcalutils4 libkcmutils4  libkde3support4 libkdeclarative5 libkdecorations4 libkdecore5 libkdesu5  libkdeui5 libkdewebkit5 libkdnssd4 libkemoticons4 libkephal4abi1 libkfile4  libkholidays4 libkhtml5 libkidletime4 libkimap4 libkio5 libkjsapi4 libkjsembed4  libkldap4 libkmbox4 libkmediaplayer4 libkmime4 libknewstuff3-4 libknotifyconfig4  libkntlm4 libkonq-common libkonq5-templates libkonq5abi1 libkonqsidebarplugin4a  libkparts4 libkpimidentities4 libkpimtextedit4 libkpimutils4 libkpty4  libkresources4 libkrosscore4 libkscreensaver5 libksgrd4 libksignalplotter4  libktexteditor4 libkunitconversion4 libkwineffects1abi3 libkwinglutils1  libkwinnvidiahack4 libkworkspace4abi1 liblwp-mediatypes-perl  liblwp-protocol-https-perl libmailtools-perl libmailtransport4 libmicroblog4  libnepomuk4 libnepomukdatamanagement4 libnepomukquery4a libnepomuksync4  libnepomukutils4 libnet-http-perl libnet-ssleay-perl libntrack-qt4-1 libntrack0  libopenexr6 libphonon4 libplasma-geolocation-interface4 libplasma3  libplasmaclock4abi3 libplasmagenericshell4 libpolkit-qt-1-1 libprison0  libprocesscore4abi1 libprocessui4a libqalculate5 libqapt-runtime libqapt1  libqca2 libqimageblitz4 libqrencode3 libqt4-qt3support libsocket6-perl libsolid4  libsolidcontrol4abi2 libsolidcontrolifaces4abi2 libsoprano4 libstreamanalyzer0  libstreams0 libsyndication4 libtaskmanager4abi3 libthreadweaver4  libtimedate-perl liburi-perl libvirtodbc0 libweather-ion6 libwww-perl  libwww-robotrules-perl libxml2-utils libxss1 mysql-client-core-5.5  mysql-server-core-5.5 ntrack-module-libnl-0 odbcinst odbcinst1debian2  oxygen-cursor-theme oxygen-icon-theme phonon phonon-backend-gstreamer  plasma-dataengines-workspace plasma-desktop plasma-scriptengine-javascript  plasma-widget-folderview plasma-widgets-workspace qapt-batch  shared-desktop-ontologies soprano-daemon systemsettings virtuoso-minimal  virtuoso-opensource-6.1-bin virtuoso-opensource-6.1-common
share|improve this answer
Removing kde-desktop will not actually remove any packages. – terdon May 2 '14 at 11:58
I wish I gave this a go now. – adampski May 2 '14 at 14:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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