What should I do when Ubuntu freezes?

That Kind of problem occcurs in most Ubuntu Users!
But the reasons are different.
So I search the answers for u with different conditions and 100% tested.

 How to reboot a frozen ubuntu-the-safe-way!

If your ubuntu gnome crashes while you working on it,and nothing you have entered seems to work.Following steps may help you reboot the frozen ubuntu in the safe way.It’s far better than pushing that power button.

Try these steps:
Hold down Alt+Sys Rq(PrtScn key)key combination.
There will be no visible output,while hold down the key combination,
Then press these keys in the order,one by one
Spells “busier” backwards,and the system will be reboot after B is typed in the safe way.

When a single program stops working:

When a program window stops responding, you can usually stop it by clicking the X-shaped close button at the top left of the window. That will generally result in a dialog box saying that the program is not responding (but you already knew that) and presenting you with the option to kill the program or to continue to wait for it to respond.
Sometimes this does not work as expected. If you can’t close a window by normal means, you can hit Alt+F2, type xkill, and press Enter. Your mouse cursor will then turn into an X. Hover over the offending window and left-click to kill it. Right clicking will cancel and return your mouse to normal.
If your program is running from a terminal, on the other hand, you can usually halt it with Ctrl+C. If not, find the name and process ID of its command, and end it with kill [process ID here]. If that fails despite waiting a few seconds, try sending a SIGHUP: kill -HUP [process ID here]. If all else fails, as a last resort send SIGKILL (-9): kill -9 [process ID here]. Note that you should only use SIGKILL as a last resort, because the process will be terminated immediately with no opportunity for cleanup.

When the mouse stops working:

If the keyboard still works, press Alt+F2 and run gnome-terminal (or, if these fail to launch, press Alt+Ctrl+F1 and login with your username and password). From there you can troubleshoot things. I’m not going to get into mouse troubleshooting here, as I haven’t researched it. If you just want to try restarting the GUI, run sudo service lightdm restart. This should bring down the GUI, which will then attempt to respawn, bringing you back to the login screen.

When everything, keys and mouse and all, stop working:

If that doesn’t work, press the Reset button on the computer case. If even that doesn’t work, you’ll just have to power-cycle the machine.
May you never reach this point.

error: Content is protected !!