What should I do when Ubuntu freezes?
Linux has always been famous for its reliability relative to Windows, but there are problems here too. In Ubuntu, applications also sometimes freeze, like the operating system itself, so I recommend that you read this article in case something like this happens to you.
What to do if a program freezes in Ubuntu?
The system itself, the kernel or the graphical shell very rarely freeze. They have already been tested many times, rechecked and quite stable. But third-party programs can freeze quite often, even for no reason. These freezes are not dangerous for the system and are very easy to solve. Ubuntu provides several graphical utilities for terminating frozen applications.
Let's imagine that your Telegram messenger is frozen.
- First, open a terminal by pressing the keyboard shortcut Ctrl + Alt + T.
- Now let's try to find out the PID of the Telegram process using the ps command:
ps aux | grep telegram
- The PID of the frozen program has a value of 4345. Now let's proceed to terminate the process.
- Terminate the process using the command:
Don't like the Terminal? No problem. Ubuntu has a System Monitor. All running applications are displayed here, and any of them can be terminated through the context menu. To open it, type System Monitor in the Dash search:
To kill a process, right-click on it and click "kill":
What to do if the desktop environment freezes in Ubuntu?
What if the Ubuntu desktop environment is completely frozen and you cannot start the system monitor or open a terminal? This can happen for various reasons, for example, due to incorrect drivers or an error in system programs. But what makes Linux unique is that in addition to the desktop environment, there is also a terminal mode. The desktop environment is frozen, but the system is still working. Therefore, we can fix everything.
First, let's try to restart the X server. To do this, hold down the keys: Ctrl + Alt + Backspace
If this doesn’t help, go ahead.
By default, any Linux distribution has 12 system terminals open. You can use one of them. More precisely, only 11 are available to you, because your desktop environment in which you are working is already open in one. Usually, this is the first or seventh terminal.
Therefore, hold down the Ctrl + Alt + F7 keys and enter the following command in the terminal:
sudo service lightdm restart
What to do if Ubuntu freezes completely?
If the system no longer responds to anything, but the kernel is most likely working, then you can try to perform a safe reboot. The kernel supports several keyboard shortcuts that can be used to directly issue commands.
To do this, simultaneously press the Alt + PrintScreen/SysRq keys, then sequentially with short pauses, the keys - R E I S U B.
The device will then reboot.
But if this doesn’t help (unlikely), then just turn off the device by holding the power button for 5-7 seconds.
As you can see, there are many ways to solve this problem. We've covered everything you need to get your system back on track, and you know what to do if Ubuntu is frozen and how to close a frozen application. If you are familiar with other ways to solve this type of problem, I’ll be happy to supplement the article with new material, just write in the comments.