Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How to restart window manager so that styles (or whatever) are restored?

After doing /etc/init.d/networking stop they feel completely broken.

share|improve this question
2  
This is not an answer in any way but just saying, a nicer way to stop the networking service is by sudo service networking stop – nitstorm Sep 30 '11 at 17:11
Or sudo stop networking. – Eliah Kagan Jul 6 '12 at 17:58

6 Answers

up vote 11 down vote accepted

You may need to restart your display manager to fix your problem.

Also the following no longer works in 11.10:

sudo service gdm restart #This won't work in 11.10, but works in 11.04 and older versions

In Ubuntu 11.10 onward, you need to use lightdm:

sudo service lightdm restart

lightdm replaces gdm in Ubuntu 11.10

Restarting Unity ('setsid unity' OR 'unity --restart' on the CLI OR Alt+F2 and type 'unity') restarts the Unity shell, while restarting lightdm restarts the entire display manager. Which you need to do depends on how broken your session is. If you can just restart Unity, do that. If that doesn't work, restart lightdm.

The following wiki article has additional information about fixing LightDM issues:

https://wiki.ubuntu.com/LightDM

share|improve this answer

Press ALT + F2 and type "unity", then press enter (this is the same as running "unity --replace").

share|improve this answer
3  
IMO this is the correct answer to the exact question. Restarting lightdm/gdm will restart your entire X session – Collin Peters May 10 '12 at 15:13

You should type: sudo service XXX restart

The XXX should be (without quotes):

  • gdm if you use Ubuntu 11.04 or older
  • lighdm for Ubuntu 11.10
  • kdm for Kubuntu
  • xdm for Xubuntu

In case you have installed another display manager on your (K/X/L)Ubuntu you should restart the one you're using e.g. if you have installed KDE on Ubuntu (and it's the one you're using) you should restart kdm not lighdm.

In case you are not sure what to restart see the files in /etc/init.d/ and see if there is a file with a name that contains the XXX already mentioned, or something like YYYdm (the dm stands for "display manager").

share|improve this answer

Try the following:

setsid unity

If that doesn't work, try restarting X. Note that this will crash everything:

sudo service gdm restart
share|improve this answer
setsid unity seemed to launch something but styles remain broken. sudo service gdm restart fails with restart: Unknown instance:. This way it ends very often when I try to restart service, so in most cases I have to stop-start them. – Dmitry F. Volosnykh Oct 8 '11 at 14:14
1  
This is because Oneiric uses lightdm by default, so you would need to type sudo service lightdm restart. – Nathan Osman Nov 15 '11 at 20:07

There are few methods to restart X.

If everything froze for example, you can kill it by pressing Clt+PrtScr+K.

Or you can restart it from terminal, as described in previous answers.

More details on how to Restart X in Ubuntu.

share|improve this answer

If everything freezes, another place you might want to restart lightdm from is from a tty:

  • hit Ctrl + Alt + F2
  • login
  • type: sudo service lightdm restart
share|improve this answer

Your Answer

 
discard

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.