Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I'm currently setting up a home server using a very, very old PC. It has Ubuntu 11.10 installed on it, but it can't actually handle the GUI. I want to install the server edition of Ubuntu, which is command line only, but have no idea how to do so. What can I do?

share|improve this question

4 Answers 4

up vote 2 down vote accepted

Actually, if you just have problem with running the GUI there's no need to install another distribution, simply modify the startup sequence to prevent the graphical interface from coming up and work from the command line as you desire.

I don't have access to a system right now, but I believe the script you'll need will be found in the /etc/init.d or /boot/grub directory. Perhaps someone here can give you the name of the script before I get home to check.

I just found this: Starting Ubuntu without the GUI

I see three ways to do it:

  1. Changing the default runlevel

    You can set it at the beginnign of /etc/init/rc-sysinit.conf replace 2 by 3 and reboot. You can enable the graphical interface with telinit 2.(More about runlevels)

  2. Do not launch the graphical interface service on boot

    update-rc.d -f xdm remove

    Quick and easy. You can re-enable the graphical interface with service xdm start or revert your changes with update-rc.d -f xdm defaults

  3. Remove packages

    apt-get remove --purge x11-common && apt-get autoremove

    I think it suits best for a computer considered as a server. You can re-enable the graphical interface by reinstalling the packages

There's also this: Possible to install ubuntu-desktop and then boot to no GUI

The point being, you can prevent the GUI from coming up if that's your main issue.

share|improve this answer
I tried the second method, to no effect. After trying the third method, I get nothing. No root prompt, no command line, not even a blinking cursor. Luckily, there's no actual data on this computer (yet), besides the OS. What can I do next? – Jules Mazur Jun 2 '12 at 19:18
@Verandaguy Oh, sorry to hear this. It's hard to say w/o detailed knowledge of your system what to do next. Changing the startup/boot sequence is not for the faint of heart, but I am relieved to hear that the system only contains the OS. so the worst case is somewhat limited (still a hassle I realize). I still think you should be able to recover from this with the help of the live CD which should let you boot into the system. From there you could undo the changes you made (or assuming you made copies of the files before you modified them, copy them back). – Levon Jun 2 '12 at 22:13
Alright, I have no idea what I did, but I rebooted, and it naturally booted into server 12.04. Strangely enough, I didn't see any install/try screens (the server CD is in the drive, but not installed), and since it's 12.04, it has to be server, rather than a GUI-less desktop edition. Thanks anyway, it seems my computer boots into server through restarts, and without the CD. I'm not complaining. – Jules Mazur Jun 3 '12 at 1:46
@Verandaguy happy to have, what appears, a happy ending. Sorry for the scare (I'm sure - I'd have been worried too) – Levon Jun 3 '12 at 1:47
Not much of a scare, to be honest. Like I mentioned, it's basically an empty computer, apart from Ubuntu itself. – Jules Mazur Jun 3 '12 at 2:18

If you uninstall the desktop packages and install the server packages through tasksel, you should be prepared to do a LOT of reconfiguration, as this will remove your network settings, wireless card drivers, etc.

If all you need to do is get rid of the gui, follow steps 1-2 from the first answer. It's up to you whether or not to purge the GUI completely.

I also replaced the generic kernel with the server kernel as noted in the answer @warl0ck and commented out the lines in the lightdm.conf file.

After this, rather than tasksel to add/remove packages, I manually removed packages from the command line. Unless you're going to use the LibreOffice suite, Firefox, etc., you can remove all these packages. The easiest way to get a list of packages is to run:

sudo dpkg --get-selections | grep -v deinstall > ~/packages
nano ~/packages

This will output a list of all installed packages to your home folder and open it.

When you uninstall a core package (such as libreoffice-common), it should automatically remove dependent packages.

To uninstall, type

sudo apt-get remove package-name

Once all the uninstalls are done, run the following command to autoremove package listings and dependencies no longer used.

sudo apt-get autoremove

This worked for me turning my desktop installation into a "server."

If the GUI would be useful, you might look into installing xubuntu instead, as it's a much lighter distribution. I didn't particularly care for it, but it's definitely more lightweight.

share|improve this answer

I think that an easy way is with tasksel via command line.
Open a terminal and digit:

$ sudo apt-get install tasksel


$ sudo tasksel

It will show a simple gui-cli that lets you to choose what you want by a simple check/uncheck (for eg. uncheck "Ubuntu desktop" and also check "Basic Ubuntu server" and "LAMP server".
That's it

share|improve this answer
Is "Basic Ubuntu Server" an option within tasksel? And why would OP want to install the LAMP stack? – jasonwryan Feb 23 '14 at 5:21
Yes, see this other question. However, Basic Ubuntu Server do not contains LAMP (Linux Apache MySql PHP) packages. For any kind information, see the official documentation – Alessandro Gubitosi Feb 25 '14 at 4:47

There's no difference between a server and desktop distribution , just involving different packages.

The two things you should do was:

  1. Replace default generic kernel with server kernel , by: apt-get install -y linux-image-server
  2. Disable or remove all graphical software , xorg-server.

    To disable them , disable lightdm for auto start , edit /etc/init/lightdm.conf , comment all these lines (place a '#' in front of each line)

start on ((filesystem
           and runlevel [!06]
           and started dbus
           and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1
                or stopped udev-fallback-graphics))
          or runlevel PREVLEVEL=S)
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.