Switching between Ubuntu Desktop and Ubuntu Server


It’s easy enough to start out with an Ubuntu Server machine and install the desktop packages, leaving you with an Ubuntu Desktop machine. Just run:

sudo aptitude install ubuntu-desktop

…and you’re done. Unfortunately, going the other way isn’t so easy. Just removing the ubuntu-desktop package doesn’t remove all the other packages for me, I had to list a whole bunch of packages (enough to trigger all the dependencies, and get all the other desktop packages autoremoved). Long story short, I just fired this (very long) command and it did what I was after:

sudo aptitude remove ubuntu-desktop gdm nautilus \
xserver-xorg libgtk2.0-common metacity x-session-manager \
gnome-session xorg capplets-data gedit-common \
gnome-panel gnome-orca gnome-control-center libgnome2-0 \
mousetweaks network-manager synaptic evolution \
gcalctool gconf2 software-center nautilus-data \
rhythmbox vino vlc update-manager firefox compiz-core \
network-manager-pptp openoffice.org-help-en-us \
gnome-media-common gnome-panel-data gnome-screensaver \
gnome-terminal-data gstreamer0.10-plugins-base \
indicator-me indicator-messages indicator-session \
update-notifier indicator-applet \
indicator-applet-session libappindicator1 \
libcanberra-gtk0 empathy-common evolution-common \
evolution-plugins gwibber-service ibus jockey-gtk \
libbrasero-media1 libpam-gnome-keyring \
nautilus-sendto-empathy rhythmbox-plugins \
xul-ext-ubufox empathy gnome-applets gnome-keyring


  • Make sure you’re not in a GNOME session while you’re doing this, or it could have unexpected results.
  • It’ll remove a lot more packages than those listed above. Read the list of packages that are going to be removed CAREFULLY and be sure before you confirm the removal.
  • You may not hold me responsible if you hose your system by blindly removing packages. You should know what you’re doing before attempting this, if you’re not sure what will happen, you should do some more research first.
  • If you don’t have aptitude installed, just replace “aptitude” with “apt-get” in the commands above. I prefer aptitude, so that’s why it’s in the commands above.
  • My scenario: I started off with an Ubuntu Server 10.10 (not a fresh install, I’d been using it a while, so forget this being a clean experiment!), then installed the Desktop, installed Chromium and Flash, then switched back to Ubuntu Server.
  • This will almost certainly need some tweaks to work on earlier or later versions of Ubuntu than 10.10. If you do tweak the above command for another version and you feel like helping out, please comment with the relevant remove command that worked for you so it can be shared.

If this works for you, drop me a comment below!

PS: Nope, I don’t understand that photo either. :)

8 thoughts on “Switching between Ubuntu Desktop and Ubuntu Server

  1. Interesting. Wouldn’t tasksel just remove the ubuntu-desktop package though, leaving all the other cruft behind? I’ll have to fire up a VM at some point and play with that. If it works, it’d definitely be far simpler than my approach…

  2. Thanks for the page… a hell of alot easier than #sudo rm -rf /* :-) (WARNING: DO NOT DO THAT COMMAND!)

  3. Thanks, as a student there are only a very few great resources, and this is a great resource.

Leave a Reply

Your email address will not be published. Required fields are marked *