Alt+PrtSc+K is not working on my machine. I'm currently using Ubuntu 14.04.1 LTS. The shortcut used to work on older Ubuntu releases (whose purpose was to kill the display server). Any suggestions?
That shortcut used to kill the X server.– ramonSep 21, 2014 at 13:31
sudo dpkg-reconfigure keyboard-configuration and when you see this window just select "yes".
And the next time use Ctrl+Alt+Backspace to kill X.
Thanks for the answer, but according to the Magic SysRq keys the Alt+PrntSc+K should "kill all processes on the current virtual console". I'm wondering why this is not the case.– ramonSep 21, 2014 at 13:42
@KasiyA As far as I've read myself through lots of documentation, Ctrl-Alt-Backspace is NOT the same as Alt+PrtSc+K! While the former is only intended to shut down the X server, the latter will operate on a level much closer to the kernel, i. e. even cause some problematic drivers to get reconfigured. Hitting the SysRq key combination too often (in despair, because things went really wonky on here) even caused a kernel panic here and there, whilst this has never happened with Ctrl-Alt-Backspace to this day. Jul 26, 2015 at 9:54
By default, in Ubuntu 14.04, the Magic SysRq keys are disabled. To enable the Magic SysRq keys open the file /etc/sysctl.d/10-magic-sysrq.conf and change the line
kernel.sysrq = 176
kernel.sysrq = 1
Then reboot your Linux box.
In addition to what ramon wrote, here's a solution to (re-)enable Alt+PrtSc+K even without reboot!
I found it all by myself, as the documentation about it is abysmal (to say the least).
Here on Lubuntu, the original value in
/proc/sys/kernel/sysrq is 176. This caused SysRq+K to be completely disabled.
To understand this, you have to know a little about bits, bit masks and hexadecimal numbers:
- 176 is
$B0in hex, or
1011 0000in binary.
To make Alt+PrtSc+K work, the second bit must be set:
1011 0000 OR 0000 0100=
This will be
$B4 in hex or 180 in decimal.
So here we go:
$ sudo sh -c "echo 180 > /proc/sys/kernel/sysrq"
The SysRq combination should work perfectly now, and without requiring reboot nor logout.
When you say "second bit", shouldn't it be 1011 0000 OR 0000 0010 = 1011 0010? Jul 27, 2016 at 17:59