17

When I start Ubuntu it enters tty[1-6] instead of my desktop. Normally I could get back to the desktop by pressing Ctrl+Alt+F7 but that doesn't work.

I tried sudo apt-get install ubuntu-desktop but it fails. I tried startx which started the x-server or x-window (not sure what it's called) but it just brought up a black screen with my mouse cursor. If I press printscreen, a dialog box would open up.

This is a fresh install of the latest version. It's dual booting with Windows 7 - but I doubt that matters. Before this happened, I installed lamp-server but realized it wasn't what I wanted. I then installed xampp and uninstalled lamp-server with sudo tasksel remove lamp-server. I restarted with sudo shutdown -r now because it would not shut down using the graphical interface.

I can't get back to my desktop. Any ideas how I can?

4
  • was this a fresh install of the latest ubuntu or did you upgrade from an earlier version? Nov 3, 2009 at 19:18
  • If you know what happened right before it starting doing this, that would also be helpful to know.
    – emgee
    Nov 3, 2009 at 19:21
  • 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.
    – Bua
    Nov 3, 2009 at 20:26
  • When you say "it fails," it helps if you can provide a specific error. There are many ways for apt to fail. Nov 3, 2009 at 21:37

8 Answers 8

20

It sounds like you might have managed to uninstall your desktop environment. (Unless Karmic has replaced GDM, which I doubt.)

If you were using GNOME, you probably installed Karmic with the ubuntu-desktop. You'll want to reinstall that:

sudo apt-get install ubuntu-desktop

...or possibly

sudo apt-get --reinstall install ubuntu-desktop

That should pull in any missing packages. Once you've reinstalled, you should be able to run

sudo /etc/init.d/gdm restart

... and get back to the GDM login screen.

1
  • I did this and it works well, but I was interested in, is it possible that something is still broken in the system? I have no idea what causes the desktop to fail on my system, but I know that I uninstalled the system python so possibly this caused it to malfunction (askubuntu.com/questions/384033/…)? I'm just worried that something is still corrupted, even if the system seems to work.
    – mavavilj
    Aug 8, 2022 at 8:03
4

I think I may be experiencing similar issues.

Since I noticed the mouse I tried Ctrl+Alt+F1 then Ctrl+Alt+F7 and it was fixed for me.

It's irritating that this happens a lot when I turn my TV off for a while then on.

3

My solution has been to edit the file /etc/lxdm/default.conf and set the server section this way

[server]
## arg used to start xserver, not fully function
arg=/usr/bin/X -background vt1
1
  • On my machine, there is no folder lxdm in the etc folder...
    – Liker777
    Jun 4, 2023 at 18:10
2

This is what worked for me.

  • Logged in to tty1
  • Purged unity-greeter which was the default lightdm greeter for my unity desktop:

    sudo apt-get remove --purge unity-greeter
    
  • Then I installed lightdm-gtk-greeter:

    sudo apt-get -y install lightdm-gtk-greeter
    
  • Restarted Ubuntu

  • Logged in to my desktop
  • Removed lightdm-gtk-greeter:

    sudo apt-get remove --purge lightdm-gtk-greeter
    
  • Installed unity-greeter:

    sudo apt-get -y install unity-greeter
    
  • Then restarted again and it worked


P.S. In case you cannot connect to internet to download and install required packages using apt-get, I suggest you manually download it from Ubuntu package archives from a working computer, save it in a usb drive, mount it from tty1, and then use dpkg to install it. Please use Google to find out how.

If lightdm-gtk-greeter works for you and you are satisfied with it, you can stop there. However in my experience, it uses slightly more memory than unity-greeter and not as aesthetically good looking as well.

1
  • That didn't work for me...
    – Liker777
    Jun 4, 2023 at 18:08
0

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.

0
  • Solution 1: See if this works for you:

First, open terminal by: CTRL+ALT+F1

sudo dpkg --configure -a
sudo apt-get update
sudo apt-get upgrade -y
sudo reboot
  • Solution 2: If the above doesn’t work, try this

First, open terminal by: CTRL+ALT+F1

sudo apt-get update
sudo apt-get install --reinstall ubuntu-desktop
sudo apt-get install unity
sudo shutdown -r now
  • Solution 3: If none of the above work for you, try this:

None of the above worked for me however, so I upgraded my Ubuntu from 14.04 to Ubuntu 16.04. All my previous files were preserved.

First, open terminal by: CTRL+ALT+F1

sudo do-release-upgrade
1
  • It says: the following packages have unmet dependencies: libeg1-mesa0 : Depends: libglapi-mesa
    – Liker777
    Jun 4, 2023 at 18:28
-1

Login, and type:

/etc/init.d/gdm restart
This should launch Gnome Desktop Manager.

1
  • This didn't work because gdm wasn't there
    – Bua
    Nov 3, 2009 at 21:15
-3

Try Control-Alt-Fn-F7 instead of Control-Alt-F7

1
  • Could you expand on this answer a bit?
    – Karu
    Mar 22, 2016 at 14:43

You must log in to answer this question.