Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

I'm coming from windows and still new to Ubuntu. Occasionally everything freezes and I lose my taskbar and launcher. What do I do? What's the Ubuntu equivalent of ctrl+alt+del in Windows? I tried alt+f2 to bring up the "special terminal," but what can I do from there? I tried "sudo shutdown now" but that didn't fully shut down the computer and I needed a hard shutdown.

If I do manage to figure out what's wrong and fix it from the alt+f2 terminal, how do I get back to the desktop?

share|improve this question

marked as duplicate by Jorge Castro, ImaginaryRobots, Stephen Myall, Thomas W., Seth Sep 6 '13 at 21:39

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.

    
you can press ctrl+alt+f1 then execute this command after login: sudo pkill Xorg, it will restart Xserver session. try it.. –  Saurav Kumar Sep 6 '13 at 15:09
    
@SauravKumar there are better ways to restart X: either sudo service lightdm restart in a VT (for unity) or Alt+SysReq+K to more directly tell X to restart (this used to be Ctrl+Alt+Backspace) –  SlightlyCuban Sep 6 '13 at 16:12
    
@SlightlyCuban: Yes that would be the better way if you know the display manager he is using.. But if you don't know anything and still want to tell a command that will definitely run then.. You know the rest.. ;) –  Saurav Kumar Sep 6 '13 at 16:16

3 Answers 3

up vote 3 down vote accepted

You may try "sudo reboot now" which will send a reboot signal and reboot the computer or sudo reboot -f now which will do the same but forcing the reboot.

Other valid commands are:

For a shutdown

sudo shutdown -h now

or

sudo poweroff

For a reboot

sudo shutdown -r now

But if everything simply halted (stopped working) you may wish to first give a chance to the killall5 command in the terminal which will attempt to log out your current session without rebooting nor shutting down. This will automatically return you to the desktop session in order to choose your username and write your password.

If you already fixed the issue in the virtual terminal you can hit CtrlAltF7 in order to return to your Desktop session.

Good luck!

share|improve this answer
    
Alt+F7? Surely you mean Ctrl+Alt+F7 (unless this has changed). –  SlightlyCuban Sep 6 '13 at 16:05
    
Oh! My God! I don't know what is happening to me today. :D My fault. Sorry, you're right. Thank you very much. :D –  Geppettvs D'Constanzo Sep 6 '13 at 16:13

Alt + SysRq + r , e , i , s , u , b (busier backwards) if can not even bring up terminal.

More details, and explanation, can be found in the "Magic SysRq Key" Wikipedia article.

share|improve this answer
1  
What does it do? –  11684 Sep 6 '13 at 17:51
    
Please explain. What does that do? –  Ajedi32 Sep 6 '13 at 17:57
    
I don't have any SysRq key on my keyboard. On my notebook the most similar key is "Stamp R Sist"("Stamp" on the desktop keyboard). What keys should I use in this case? (keyboard is an Italian standard keyboard). –  Bakuriu Sep 6 '13 at 19:54

Please try to use the following commands after switching to tty by pressing CTRL+ALT+F2 it may help you to solve your problem:

    sudo stop lightdm
    sudo start lightdm
    sudo restart lightdm
    unity --reset
share|improve this answer
2  
some times can't switch between ttys :( –  dedunumax Sep 6 '13 at 16:36

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