Unfreezing Your Linux Desktop

April 14, 2008

A friend of mine writes “…when I open some heavy sites with Firefox, my Ubuntu desktop gets freeze. I can’t close the Firefox so I find no other way than to restart my system. Aren’t there any other ways to unfreeze the system without restarting?” Yes there are!

[ad] The most efficient way to unfreeze your system is to be patience. Don’t try to open other applications, when your system is not responding. Don’t press unnecessary keys. Go have a cup of coffee, get fresh and get back. You system might have already been unfrozen or a dialog box might be waiting for you to click on that Force Quit button. (I promise you won’t be greeted by BSOD!)

If you don’t have much patience or your system just can’t unfreeze automatically, then follow these steps:

  1. Hit Caps Lock or Num Lock keys to see if your keyboard is responding, if it isn’t than you’re out of luck.

  2. Press Ctrl+Alt+F2, you will be taken to a black&white terminal window. It will ask you for your username and password.

  3. Type the following command to get the PID (process ID) of the program that is not responding (in this example Firefox) ps -A | grep firefox

  4. It will display you the PID of firefox. You should get at least two PIDs something similar to: _ 5961 ? 00:00:00 firefox-2 5977 ? 00:01:12 firefox-2-bin_

  5. Now issue the following command to kill the non-responding firefox (its PID is 5977 in this example) kill 5977 [update: If you hate working with numbers you can also kill the non-responding program by issuing: killall firefox-2-bin]__

  6. Re-check that you have successfully killed the non-responding program: ps -A | grep firefox

  7. If it doesn’t show you anything, then you are done. To exit and get back to your Graphical System, press Ctrl+Alt+F7

[ad]

Discussion, links, and tweets

By day, I ship code at MetaGeek, by night, I hack on my personal projects, and finally, when I get some off time in between, I also serve as a CTO for ClockworkEngine, LLC where so far we have launched two products - Spyglass and LightPaper. Call be a serial coder if you want.