Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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

This question already has an answer here:

I'm trying to convince Ubuntu's init system not to start X11 at boot-up. Removing gdm did not change the fact that each time the machine restarts, X11 with Gnome comes up.

How do I get rid of it? I need to auto-login as root with no Xserver after startup. It's inteded for a very specific automation-purpose to behave like that and not meant for Desktop experience ;)

share|improve this question

marked as duplicate by Paranoid Panda, Ravan, Rinzwind, Eric Carvalho, muru Dec 28 '15 at 12:53

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 7 down vote accepted

There are two files controlling X startup in a standard Ubuntu installation: /etc/init/gdm.conf and /etc/init/failsafe-x.conf. While the first is owned by package gdm, the second is owned by x11-common and will be triggered if GDM fails to start, which happens in particular when you remove GDM.

However, you need not remove packages to prevent GDM from starting; it enough to tell the upstart system not to start it:

  1. edit the /etc/init/gdm.conf and the /etc/failsafe-x.conf files (it might be a good idea to make a backup copy of the files before editing)
  2. change the existing start on ... stanza with a condition that is not met in your standard environment; for instance, you might want to start X only on "runlevel 5" which is what other Linux distros traditionally did:

    start on runlevel [5]
    
  3. save your changes and restart

Complete documentation on the upstart configuration files can be read by man 5 init.

share|improve this answer

You could do:

sudo update-rc.d -f gdm remove

Then to restore:

sudo update-rc.d -f gdm default
share|improve this answer

If this is meant for a very specific, non-graphical task, ubuntu-desktop is not what you want.

I know you shouldn't need to remove things to stop them running but, frankly, you'd do better to grab the Ubuntu Server (or even minimal) CD and start from a low-level.

You're driving a tank to work. You could strip it down, breaking the way it was supposed to work and taking a long time about it... Or you could trade it in for the super-bike equivalent and just install what you need.

share|improve this answer

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