Tested on: Debian Bullseye
Unresponsive applications or even unresponsive desktop environments are not common in Debian, but it can happen. Here is how you can deal with them without holding the power button for a hard shutdown. This howto was tested on Debian Bullseye, but should also work on later versions.
Unresponsive applications
Some applications can't be closed normally from the GUI. Here are a few ways to deal with that:
Method 1: Force quit from the GUI.
Open KSysGuard, Task Manager or an equivalent.
Find the unresponsive application in the list of running processes.
Right click on the process.
Click "End process" or "Kill process" to quit the application.
Method 2: Use xkill
Open the Terminal by pressing Ctrl+Alt+T on your keyboard. (You can use Ctrl+Alt+Esc in KDE or Alt+F2 and enter the command in KRunner.)
Type the command xkill and press Enter
Your cursor will now turn into an X or skull and crossbones.
Click on the unresponsive application window to force quit.
Method 3: Use the Terminal (option 1)
Open the Terminal by pressing Ctrl+Alt+T on your keyboard.
Type the command
Code: Select all
ps aux | grep nameoftheapplication
Note the process ID of the unresponsive application.
Type the command
Code: Select all
kill PID
Method 4: Use the Terminal (option 2)
Open the Terminal by pressing Ctrl+Alt+T on your keyboard.
Type the command
Code: Select all
killall nameoftheapplication
Code: Select all
killall firefox
Unresponsive desktop environment
Method 1: Get to a virtual console
Press Ctrl+Alt+F2 (or any function key between F2 to F6) to get to a virtual console.
If you are able to get to a virtual console, you can log in as root or use the following command with sudo to restart the x server.
Code: Select all
systemctl restart display-manager
Method 2: Restart the X server (if the keyboard shortcut is enabled)
Note: This will not work unless you have enabled the shortcut.
Press Ctrl+Alt+Backspace to restart X and get back to the login screen.
Method 3: Safely restart your computer with REISUB
I use this method only as a last resort when everything else has failed.
Press and hold down the Alt and SysRq (or Print Screen) keys on your keyboard.
While holding down the Alt and SysRq keys, type the following keys (slowly) in sequence:
R: Switch the keyboard from raw mode
E: Send the SIGTERM signal
I: Send the SIGKILL signal
S: Sync all mounted filesystems
U: Remount all filesystems in read-only mode
B: Reboot the system
Your system should now shut down and reboot normally.
If you have a hard time remembering the sequence, think of this sentence: Raising Elephants Is So Utterly Boring, or as I prefer: Reading Every Inch Stimulates Understanding Better.
Edits:
16.04.23: Fixed typo and added KDE Plasma shortcut for xkill. Thanks to sunrat.