Ctrl + Alt + F4 opens a console window, where you can login and kill stuff as necessary or reboot the system. Use Ctrl + Alt + F2 or Ctrl + Alt + F1 to go back.
In some cases you can restart the gnome session by pressing Alt + F2, and the R in the window that opens. This should leave all programs running, but gnome itself will restart, so if the issue is in gnome it may help.
If the above don't help, you can do a warm reboot, by pressing the following key sequence:
While keeping pressed down both the Alt and Print Screen keys, sequentially (one by one) press the keys:
R E I S U B
This will sync and unmount the file system and do a safe reboot. The keys have the following meaning:
- R: Switch the keyboard from raw mode to XLATE mode
- E: Send the SIGTERM signal to all processes except init
- I: Send the SIGKILL signal to all processes except init
- S: Sync all mounted filesystems
- U: Remount all mounted filesystems in read-only mode
- B: Immediately reboot the system, without unmounting partitions or syncing
Source
Finally, if all else fails, keep the power-on button pressed for a few seconds to force a cold reboot, or take the power cable/battery out ;-).
SysRq
incantations. – DopeGhoti Feb 15 '22 at 19:57F
, which invokes the OOM killer, before sending any other signal to all processes. Many times I've recovered from a stray, memory hogging process without losing my current session. – Quasímodo Feb 15 '22 at 20:05echo 1 | sudo tee /proc/sys/kernel/sysrq
(enables all Magic SysRq keys; other numbers enable certain keeys and disable others). There's also a config file to do this permanently; I think/etc/sysctl.conf
. – wizzwizz4 Feb 16 '22 at 10:06Alt
andPrint Screen
keys, ..." - You don't need to hold downPrint Screen
while doing the other keys! Just hold downAlt
, and then press, in sequence,Print Screen
,R
,E
, etc. Much easier. Also considerSysRq+K
, which will kill all processes on the current virtual terminal. You'd lose your graphical session, including hopefully your runaway process, but not the system. (I'm not 100% sureSysRq+K
still works as expected with Wayland, never tried it) – marcelm Feb 16 '22 at 10:48REISUB
sequence in all cases. The idea ofR
is for example to get access to the keyboard when something blocked it by switching to a mode that does not allow you to input the commands needed to unblock it again. AndK
often works for killing an X11 session (when not even ctrl-alt-backspace is working anymore) and afterward you can login again. – allo Feb 17 '22 at 17:45