No matter how stable Linux is, sometimes applications freeze and need to be forcefully terminated. While Linux has many command-line tools for force-killing processes, there aren't as many options in the graphical interface. You can use a task manager application, or in Xorg there was the xkill utility that allowed terminating an application by selecting its window, but this utility doesn't work in Wayland.
In this short article, we'll look at how to force quit an application in Ubuntu using the graphical interface, either through the task manager or a GNOME extension.
Table of Contents
How to Force Quit an Application in Ubuntu
1. Task Manager - Mission Center
If any application hangs, you can terminate it using Mission Center. This is a simple task manager. To install the program in Ubuntu, you can use the snap package manager:
snap install mission-center
In other distributions, it can be installed from Flathub:
flatpak install flathub io.missioncenter.MissionCenter
The built-in GNOME process manager is not very convenient to use since it displays a list of all processes. Mission Center, however, shows applications with windows at the top of the list. To see this, open the Apps tab:
Then select the desired application and choose Force Stop from its context menu:
That's all.
2. Gnome Extension - Logo Menu
If you enjoyed using xkill, you can use the GNOME extension - Logo Menu as an alternative. The extension adds a menu button for GNOME, which includes, among other options, Force Quit App. Here's how it looks:
You can install the extension from the GNOME Extensions website or using Extension Manager. After activation, open the menu. Select the Force Quit App option and click on the window of the application you want to terminate.
3. Terminal
And the last method is to terminate the program in the terminal. To do this, you need to find the process identifier (PID) of the application by its name and terminate this process. If you don't know the exact name of the program, you can use ps and grep. For example:
ps aux | grep text
Now knowing the program's PID, you can send it a termination signal using the kill command:
kill -TERM 2893
Alternatively, you can use the pkill utility. You need to pass it the name or part of the program's name. The utility will try to find such a program and terminate it. For example:
pkill gnome-text
Wrapping Up
In this short article, we've explored how to terminate applications in Ubuntu. As you can see, it's quite straightforward and can be accomplished in several ways.