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 need to use Ubuntu Desktop on my server for certain reasons because I can't use Ubuntu Server, but to make it more efficient I would like to remove the desktop environment and boot straight to the shell, all the other questions I saw the answer were for older versions of Ubuntu and the commands they posted did not work, mostly because it said those packages were not found.

All in all I just need the desktop environment gone and boot to the shell.

share|improve this question
Also see How to remove desktop environments? – bain Jan 19 at 23:50
up vote 4 down vote accepted
sudo apt-get purge unity gnome-shell lightdm

sudo apt-get clean

sudo apt-get autoremove

sudo apt-get -f install
share|improve this answer
This will allow me to boot to the shell still right? – Wargog Jul 16 '14 at 16:34
yeah, and if it doesn't boot directly into the shell then you can just press ctrl+alt+f1 and that will bring you to a shell and the ubuntu/unity desktop won't be running – sbergeron Jul 16 '14 at 17:21
how can I reinstall all this. I accidentally did the above and cant recover it back – Bearded Beast May 21 at 8:34
@beardedbeast Are you able to get to a tty? If so then just do an apt-get install lightdm [desktop environment of your choice] – sbergeron May 23 at 1:51

If it is already installed, you can remove the Ubuntu Desktop metapackage and install the server softwares you need:

sudo apt-get install openssh

Configure SSH according to your needs. Then:

sudo apt-get remove ubuntu-desktop
sudo apt-get autoremove
share|improve this answer

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.