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

The new Ubuntu features a completely unkillable GDM. Is there a way to disable it?

It is not enabled in services , the GDM startup script is deleted, it is removed from update.rc but it still starts up.

How do I disable GDM and Graphical User Selection?

share|improve this question

migrated from Nov 7 '11 at 11:34

This question came from our site for system and network administrators.

up vote 19 down vote accepted

In Ubuntu 10.4 you should refer to Upstart which handles starting of tasks and services during boot, stopping them during shutdown and supervising them while the system is running.

Upstart handle start of gdm, so you should edit /etc/init/gdm.conf

# sudo vi /etc/init/gdm.conf

Default runlevel in ubuntu 10.4 is 2 so you must change this line

stop on runlevel [016]

adding "2" at runlevel list

stop on runlevel [0126]

Now you can reboot the system.

share|improve this answer


sudo dpkg-divert  --rename --add /etc/init/gdm.conf

Which prints:

Adding `local diversion of /etc/init/gdm.conf to /etc/init/gdm.conf.distrib'

This will allow you to disable GDM while preventing package upgrades from putting the file back in place and allowing the GDM package to upgrade the configuration file.

In the case of 11.x and above lightdm is used instead of GDM. I instead used the command:

sudo dpkg-divert --rename --add /etc/init/lightdm.conf

To undo it replace the rename and add with a remove.

share|improve this answer

Recent versions of Ubuntu are using upstart instead of SysV init.

Rename /etc/init/gdm.conf to /etc/init/gdm.disabled.

For Kubuntu, rename /etc/init/kdm.conf to /etc/init/kdm.disabled.

share|improve this answer

I found this thread to be very helpful:

The solution that I found that worked consistently was post 30 by iscatel:

well, this disables sound, as a previous post pointed out, but here goes:

in /etc/default/grub, comment out





sudo update-grub2

this will pass "text" on the kernel line, disabling gdm.

if it still not work, you can

echo "manual" > /etc/init/gdm.override

and try it again. I used ubuntu 12.04 32bit server with gnome core and it worked for me.

share|improve this answer
Just tried, worked great for me. Thanks. – Annika Backstrom Jun 24 '10 at 21:13

Follow the directions of @freedev:

# sudo nano /etc/init/gdm.conf

And change to:

stop on runlevel [0126]


# sudo nano /etc/init/tty1.conf

And change to:

stop on runlevel [!345]

Note the missing 2 in the tty1.conf. This is so that you get tty1 up and running and can log on into the first console. No need to mess with grub.

share|improve this answer
This isn't a threaded forum, so your instruction to "follow the directions above" don't really make sense. Can you please edit your answer to be more comprehensive? – Holocryptic May 8 '11 at 5:22
@lucian303 stop on runlevel [!345] Didn't get this portion My tty1.conf file contains: start on stopped rc RUNLEVEL=[2345] stop on runlevel [!2345] if i change from "stop on runlevel [!2345]" to "stop on runlevel [!345]" Then both the start on and stop on lines will mean the same. Please explain – Pradipto Sep 15 '11 at 8:13

You can switch to some other display manager (kdm or xdm being two most widespread alternatives, but there are many more, see Wikipedia). Just aptitude install the one you want to use, run dpkg-reconfigure gdm and select it from the list.

share|improve this answer

Why not just remove it?

apt-get remove gdm
share|improve this answer

For those who arrive on this topic, follow the instructions of freedev, but instead of stop gdm on run level 2, you should prevent it from starting on runlevel 2 :

Edit /etc/init/gdm.conf

$ sudo vi /etc/init/gdm.conf

Change this line

and runlevel [!06]

By this line

and runlevel [!026]

You can also exclude others run level (3, 4 and 5)

share|improve this answer

The prior answers (as of 20160611) are only relevant for Ubuntu versions using Upstart. Ubuntu 16.04 switched from upstart to systemd. To boot to console, rather than X, you need to change the default target to boot into from graphical to multi-user:

sudo systemctl enable --force
sudo systemctl set-default

Then reboot. To undo this:

sudo systemctl set-default

And then reboot.

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.