This question already has an answer here:
The magic SysRq key does not work on my Ubuntu 16.04 desktop. I imagine it's now disabled by default. My attempts to enable it did not work, and the only thing Google finds is a 2007 forum post from when it was apparently enabled by default.
Can I enable it? If so, how?
[Added the following after the first answer:]
According to https://en.wikipedia.org/wiki/Magic_SysRq_key "In Ubuntu the combination of Alt+SysReq acts as "print screen" command." This is in fact the behaviour I observe on a non-hung system, even after doing
sudo sysctl -w kernel.sysrq=1 I get some kind of screen capture on my desktop. Not what I want.
It's not practical to write to
/proc/sysrq-trigger from a system that's basically hung, trying to get information to debug the problem.