Kill processes and recover from system freeze
Every so often there's a program that misbehaves. There's only ONE way to deal with these insolent programs: KILL THEM ALL!
- Sudden slowdown of what you are working on
- Computer gets hotter and the fan get louder
- Unusually high amount of clicking sound and constant light that indicate the hard drive is being written or read excessively
- A program is unresponsive and the window may turn gray
Fortunately for us, the Linux operating system itself very rarely freezes.
- If you can, open up your system monitor. In Ubuntu it is under System > Administration > System Monitor
- Under the Processes tab you can see all the programs running. Click % CPU once or twice to have the largest numbers at the top.
- These are the programs using the most of the processor. If any process is using more than 30-40% of the processor, it is a suspect for the problem.
- If the whole system is unresponsive, you may still be able to use the terminal. Hold Ctrl+Alt and press F1. (Return to desktop with Ctrl+Alt+F7)
- Log in using your username and password
- Enter the command: top
- This is a system monitor that automatically sorts programs by their CPU usage, so the frozen program should be at the top of the list.
- Press q to quit top.
If you are in system monitor, right click on the process and select Kill Process and confirm. This will probably solve your issue. If not, sort the list by Process name and kill processes related to the one you already killed. Be careful, your system may become unstable if you kill a necessary process.
Method 2 (The Big Guns):
You will find several different ways of killing processes from command line on the Internet. However I have found only one that ALWAYS works.
pkill -9 processname
Just replace processname with the process you need to kill. You can then switch back to your desktop with Ctrl+Alt+F7
That's all folks!
Was this guide helpful to you? Please see how you can help us.