Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm a Windows guy, dual booted recently, and now I'm using Linux Mint 12

When a Windows desktop freezes I refresh, or if I am using a program I use alt + F4 to exit the program or I can use ctrl + alt + delete and this command will allow me to fix the Windows desktop by seeing what program is not responding and so on.

Mint freezes fewer times than my xp, but when it does, I don't know what to do, I just shut down the pc and restart it.

So is there a command to fix Linux when it freezes?

share|improve this question
add comment

8 Answers

up vote 39 down vote accepted

You can try Ctrl+Alt+* to kill the front process (Screen locking programs on Xorg 1.11) or Ctrl+Alt+F1 to open a terminal, launch a command like ps or top to see running processes and launch kill on not responding process.

share|improve this answer
add comment

Adding one more possible solution to the mix, and (apart from the accepted answer) one of the least destructive of the answers so far.

If you cannot:

  • Use keyboard/mouse to A) Run the Ctrl+Alt+* option above, B) Navigate to a utility that can be used to terminate the offending program, C) Launch a terminal to initiate a pkill <process name> (or similar, as detailed above)

-OR-

  • Switch to another virtual console (Ctrl+Alt+any one ofF1-6), to initiate a pkill <process name> (or similar, as detailed above)

... then assuming MagicSysRq support is compiled into the kernel (From http://en.wikipedia.org/wiki/Magic_keys), on a QWERTY keyboard (alternatives for the below f are provided in the aforementioned article), one can try:

Alt+SysRq(Note caveats on http://en.wikipedia.org/wiki/Magic_keys#Commands)+f to
"Call oom_kill, which kills a process to alleviate an O ut  O f  M emory condition", which (at least for me) often kills the program that is causing the issue, as it is the largest RAM consuming process running at the time.

share|improve this answer
add comment

On laptops you might need to press CtrlFnF1 to open terminal, what I do is type reboot now to restart from terminal.

To go back to the GUI from terminal on my laptop (HP G56) I have to CtrlFnF8 (apparently it could also be CtrlFnF7) and you should be back to graphical interface.

Also check http://community.linuxmint.com/tutorial/view/244

Stopping & Starting

  • shutdown -h now – Shutdown the system now and do not reboot
  • halt – Stop all processes - same as above
  • shutdown -r 5 – Shutdown the system in 5 minutes and reboot
  • shutdown -r now – Shutdown the system now and reboot
  • reboot – Stop all processes and then reboot - same as above
  • startx – Start the X system
share|improve this answer
add comment

Another suggestion if you are using Gnome3 (I think the default Mint installation uses something similar), you can use CTRL+F2 then press R and hit return. I use this often and it works. It basically restarts the GUI. Even if you don't see anything on the screen (e.g., it is frozen) you should do that and it will restart the GUI.

share|improve this answer
    
ctrl f2 does not work anymore :( dunno why –  Someone Like You Feb 16 '12 at 20:10
    
maybe isn't works in the Mint GUI, since the default Mint GUI isn't exactly Gnome, but on Gnome 3 it works for sure. –  Hanan N. Feb 16 '12 at 20:51
1  
Instead of Ctrl+F2, press Alt+F2. Then it works fine. –  user16437 Mar 9 '12 at 16:43
    
This changed in GNOME3. Pressing Alt+F2 will open a run box where you can type the command r. This is restarting gnome-shell, which in GNOME 3.x has had many memory leaks which lead to it becoming slower and slower over time. Performing this restart released much of this RAM. –  slm Mar 8 at 6:39
add comment

Besides what was already mentionned, I also use those tricks:

  • If by any chance the unresponsive program was started in a terminal, I would try a Ctrl+D or Ctrl+C. If nothing happens I'd try a Ctrl+Z followed by a ruthless kill.

  • If I knew the responsible program, I would open a terminal and use killall. (E.g., killall firefox)

  • Alternatively, under Gnome, I would launch run command and invoke xkill, which allows you to kill a program by simply clicking on a window it owns.

  • Finally, just in case my keyboard melts, I have a System Monitor applet (also under Gnome) which will pop up the gnome-system-monitor when clicked. From there, I can kill any process I own using only my mouse.

share|improve this answer
add comment

If all else fails, you Raise The Elephant. Essentially, there are special Alt+SysRq+? key sequences that the Linux kernel handles special.

If your Linux box freezes and simply won't yield to any other key-commands, you should definitely try one particular key sequence before a hard reboot.

The key sequence is popularly remembered with the nemonic:

Raising Elephants Is So Utterly Boring

Alt+SysRq+R switch keyboard to 'raw' mode

Alt+SysRq+E send SIGTERM (termination) signal to all processes except mother init

Alt+SysRq+I send SIGKILL signal to all processes, a little more aggressive

Alt+SysRq+S sync all filesystems to prevent data loss

Alt+SysRq+U remount filesytems as read-only

Alt+SysRq+B forcefully reboot

http://en.wikipedia.org/wiki/Magic_SysRq_key

share|improve this answer
3  
This does, of course, require that Magic SysRq support is compiled in. –  Alexios Mar 14 '12 at 13:58
    
Do these also work as single independent commands? Like the R one followed by the E or I to just kill all and not restart? –  arsaKasra Jan 13 at 20:28
    
Yes, they should work as independent commands. Check the wikipedia page for more details. –  solo Jan 14 at 20:32
    
Problem: some modern keyboards do not have a SysRq key... (the one I'm typing from right now doesn't, for instance - although it does have "print screen", "scroll lock" and "pause/break") –  Dalker Feb 26 at 10:28
add comment

Since Linux Mint is Ubuntu based, in Ubuntu 11.10 (I know, its Unite, never tryed in Mint) Ctrl+Alt+F7 gave me the best result in solving this kind of problem.

With a single shot!-)

share|improve this answer
    
How does switching to the virtual console that GUI's are usually running under, solve the OP's problem? –  user66001 Dec 30 '13 at 5:09
add comment

In most distros pressing Ctrl+Alt+Backspace kills the X11 (graphic) interface and restarts it. Unfortunately some recent, supposedly "user friendly" distros deactivated this very useful shortcut for some unfathomable reason. I don't know if Mint is so "user friendly" but you have nothing to lose trying it :)

share|improve this answer
2  
Make sure this is enabled in Mint by searching for 'Startup Applications' in the menu, and then making sure 'Ctrl Alt Backspace' is checked. –  Jeshurun Apr 12 '13 at 10:58
add comment

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.