First, do this
which gdm
You should get a response like /usr/bin/gdm
. If you get an empty line, then gdm is not installed. Re-install it.
After confirming it is there, look in /etc/init.d
ls /etc/init.d | grep gdm
You should, once again, get a line confirming that it is there. Since you were apparently able to run sudo service gdm start
, it definitely should be there.
Now, check for /etc/X11/default-display-manager
cat /etc/X11/default-display-manager
From what I read, you may not have this. If you don't, then create the file.
sudo cat << . >> /etc/X11/default-display-manager
/usr/bin/gdm
.
Now, restart your system and see if gdm automatically starts or not. This is where everything should fall into place. However, sometimes things aren't that simple.
If it fails, look in /etc/init.d
and /etc/init
again, for anything matching "dm"
ls /etc/init{,.d} | grep dm$
You'll get a list of all files ending in "dm". Among those, you should see gdm
.
If you see any other files, then create a directory /etc/init-disabled
(the name is arbitrary) and move the offending filed into that directory. Don't delete them. They might be important for some other service you have.
For example, if you have lxdm hanging around...
sudo mkdir /etc/init-disabled
for i in $(find /etc/init{,.d} -name "*lxdm*"); do
mv "$i" /etc/init-disabled/
done
Then restart your system once again
If all else fails, try starting X directly using the name of the desktop/window manager. Since you're talking about gdm, I assume you're using gnome, and I believe the command to start gnome is gnome-session
.
xinit /usr/bin/gnome-session -- /usr/bin/X :0
I personally run my system without a display-manager, and just have my .bashrc start up my session automatically if $(tty) == /dev/tty1
and $SHLVL == 1
. So I've had to get quite intimate with this stuff.
was this a fresh install of the latest ubuntu or did you upgrade from an earlier version? – quack quixote – 2009-11-03T19:18:00.307
If you know what happened right before it starting doing this, that would also be helpful to know. – emgee – 2009-11-03T19:21:50.907
Fresh install of the latest version. Before this happened, I installed lamp-server, xampp then uninstalled lamp-server with "sudo tasksel remove lamp-server". I forgot to add that to the original question. I will edit it in now. – None – 2009-11-03T20:26:24.083
When you say "it fails," it helps if you can provide a specific error. There are many ways for apt to fail. – Ryan C. Thompson – 2009-11-03T21:37:22.817