Why Ubuntu Freezes and How to Fix It Fast
Ubuntu frozen? Close the stuck app, recover from a text console, restart safely with the SysRq keys, then find the cause in the logs and stop it coming back.
4 min readBy Daniel
Reviewed by the AmazingRDP technical team

A server that keeps running out of memory needs more of it. See Linux VPS plans with the memory your workload needs. See Linux VPS from $6.99
When Ubuntu stops responding, the power button is the last thing to reach for. Most freezes leave part of the system working, and you can get back in without losing work. Find out which kind of freeze you have, then use the matching fix.
Which kind of freeze?
| What you see | What it is | Go to |
|---|---|---|
| One window is stuck, the rest works | A frozen program | Step 1 |
| The whole desktop is stuck, the mouse may still move | The desktop has hung; the system is still running | Step 2 |
| Nothing reacts at all | A full freeze | Step 3 |
1. Close a frozen program
Ubuntu usually offers a "Force Quit" window after a few seconds. If it does not, open a terminal with Ctrl + Alt + T and use one of these:
xkill
The pointer becomes a cross; click the stuck window to close it. (On newer Ubuntu versions with Wayland this works only for older programs.)
pkill firefox
pkill -9 firefox
The first line asks the program to close; the second forces it. Replace firefox with the program's name. For a list with a "kill" button, run gnome-system-monitor.
2. Recover a frozen desktop from a text console
- Press
Ctrl + Alt + F3. A black screen with a login prompt appears (tryF4toF6if not). - Sign in with your user name and password.
- Run
topand look at the first lines: the program using nearly all of the processor or memory is the likely cause. Note its number in the PID column and pressq. - Stop it:
kill 12345
kill -9 12345
Use the second line only if the first has no effect. Go back to the desktop with Ctrl + Alt + F2 (or F1). If the desktop itself is the problem, restart it. This closes your open programs but is cleaner than the power button:
sudo systemctl restart gdm3
3. A full freeze: restart safely with SysRq
The Linux kernel listens for a special key combination even when everything else is stuck. Hold Alt and SysRq (the Print Screen key; on some laptops with Fn), and press these keys slowly, a second or two apart:
| Key | What it does |
|---|---|
| R | Takes the keyboard back from the desktop |
| E | Asks all programs to end |
| I | Forces the remaining programs to end |
| S | Writes unsaved data to the disk |
| U | Sets the disks to read-only |
| B | Restarts the computer |
The sequence is known as REISUB. On a standard Ubuntu installation only the last three (S, U, B) are switched on, and those are the ones that protect your files. To allow all of them, now and after every restart:
echo 1 | sudo tee /proc/sys/kernel/sysrq
echo "kernel.sysrq = 1" | sudo tee /etc/sysctl.d/90-sysrq.conf
Only if this fails too: hold the power button for about ten seconds. The system checks its disks at the next start.
4. Find the cause
After the restart, read what the system logged before it froze:
journalctl -b -1 -p err
journalctl -k -b -1 | grep -iE 'out of memory|oom|i/o error'
The first command shows errors from the previous start; the second looks for the two most common causes in the kernel's messages. For a known time, add --since "2026-11-19 10:00" --until "2026-11-19 11:00".
5. The usual causes and their fixes
- Memory is full. The most common cause by far: the system starts using the disk as memory and everything crawls. Check with
free -h. Close heavy browser tabs, add memory or swap, and installearlyoom(sudo apt install earlyoom), which ends the greediest program before the system locks up. - The disk is full. Check with
df -h. A full root partition makes logins and updates fail in odd ways. - The graphics driver. Freezes during video, games or when waking from sleep point here. Install the recommended driver with
sudo ubuntu-drivers install, or try the other session type (the gear icon on the login screen switches between Wayland and Xorg). See how to check GPU information in Linux. - Outdated software. Run
sudo apt update && sudo apt full-upgradeand restart. - A failing disk or memory module. "I/O error" in the log points to the disk; check it with
sudo smartctl -a /dev/sda(packagesmartmontools). Random freezes with no log entry can be bad memory: run the memory test from the start menu of an Ubuntu USB stick. - Heat. A laptop that freezes under load may be overheating.
sensors(packagelm-sensors) shows the temperatures.
When a server "freezes"
An Ubuntu server has no desktop. When SSH stops answering, the cause is nearly always memory or disk. Restart it from your provider's control panel, then run the commands from steps 4 and 5. If the log shows "Out of memory" again and again, the workload needs more memory than the server has: add swap as a stopgap, or move to a larger Linux VPS. Related guides: fix "sudo: command not found" in Linux and copy and paste in Ubuntu Server.
Questions
Why does Ubuntu freeze randomly?
Most often the memory is full. Other causes are a full disk, the graphics driver, overheating, or failing hardware. The log from the previous start usually shows which.
How do I unfreeze Ubuntu without restarting?
Press Ctrl + Alt + F3, sign in on the text console, find the stuck program with top and end it with kill.
What is REISUB?
A key sequence, pressed while holding Alt and SysRq, that tells the Linux kernel to end programs, save data and restart safely.
Is holding the power button safe?
It is the last resort. Unsaved work is lost, and files being written at that moment can be damaged.