sodcalculator

10 Tech How-To

Fix Ubuntu 22.04 Slowing Down & Freezing

Guide 10-51821 · Updated · Step by step

If your Ubuntu 22.04 system has become sluggish, takes ages to open apps, or freezes completely, this guide will help you diagnose and fix the most common causes. You’ll work through memory, disk, graphics, and system log checks, applying safe fixes that don’t require reinstalling. No special tools are needed—just a terminal and a few minutes.

What You’ll Need

  • A user account with sudo privileges
  • Access to a terminal (Ctrl+Alt+T)
  • At least 10 minutes of uninterrupted time
  • An internet connection for installing any missing packages

Step-by-Step

  1. Check system memory (RAM) usage. Run free -h in the terminal. If the available column is very low (under 500 MB) and the swap usage is high, your system is running out of memory. Close heavy applications or consider adding more RAM if this is a constant issue.
  2. Inspect disk space and I/O. Run df -h to see if the root partition (/) is near full (above 90%). A full disk causes severe slowdowns and freezes. If it’s full, remove old kernels (sudo apt autoremove), clear package cache (sudo apt clean), and move large files to external storage.
  3. Check for high CPU usage. Run top or htop (install with sudo apt install htop if needed). Look for processes eating 100% CPU. Common culprits are background updates, GNOME Shell extensions, or a runaway browser. Kill the process with kill [PID] or restart the app.
  4. Review system logs for errors. Run journalctl -p 3 -xb to see critical errors since boot. Look for lines mentioning GPU, drm, thermal, or oom (out of memory). These can point to hardware or driver issues.
  5. Update your system and drivers. Run sudo apt update && sudo apt upgrade to install the latest kernel and driver fixes. For NVIDIA GPUs, check if the proprietary driver is installed via ubuntu-drivers devices and install the recommended one with sudo ubuntu-drivers autoinstall. Reboot after.
  6. Disable unnecessary startup applications. Open “Startup Applications” from the app menu and uncheck anything you don’t need at boot. Fewer background processes means less strain on your RAM and CPU.
  7. Adjust GNOME animations (if using default desktop). Run gsettings set org.gnome.desktop.interface enable-animations false to reduce GPU load. This can make the interface feel snappier on older hardware.
  8. Check for overheating. Install lm-sensors (sudo apt install lm-sensors) and run sensors. If CPU temperature is above 90°C, your system may be throttling. Clean dust from fans, ensure proper ventilation, and consider replacing thermal paste.
  9. Test your disk for errors. Run sudo badblocks -sv /dev/sda (replace /dev/sda with your disk name from lsblk). This can take hours, but it will reveal failing hardware. Also run sudo fsck -f /dev/sda1 (your root partition) from a live USB if you suspect filesystem corruption.
  10. Try a different desktop environment (optional). If GNOME is too heavy, install Xfce (sudo apt install xubuntu-desktop) or LXQt. Log out and select the new session from the gear icon. This can drastically improve performance on low-spec machines.

Common Mistakes

  • Killing system processes like systemd or Xorg—this will crash your session. Only kill processes you recognize as user apps.
  • Running fsck on a mounted disk—this can cause data loss. Always unmount first or use a live USB.
  • Ignoring thermal throttling—overheating is a common cause of freezes, and simply adding more RAM won’t help.
  • Disabling swap entirely—while it may seem good, it can cause out-of-memory crashes. Instead, lower swappiness (sudo sysctl vm.swappiness=10).

Tips

  • Use systemd-analyze blame to see which services slow down boot.
  • Consider using a lightweight web browser like Falkon or Midori if Firefox/Chrome eat too much RAM.
  • Regularly clean temporary files with sudo apt clean and sudo journalctl --vacuum-size=50M.
  • If you have an SSD, enable TRIM with sudo systemctl enable fstrim.timer to maintain performance.
  • Create a swap file if you only have a swap partition: sudo fallocate -l 2G /swapfile, then configure it.

Troubleshooting

If the system freezes completely and you can’t run commands, try the following:

  • Use Magic SysRq keys: Press Alt+SysRq followed by R E I S U B (with a few seconds between each) to safely reboot. This is a kernel-level emergency restart.
  • Boot into recovery mode: At the GRUB menu, select “Advanced options for Ubuntu” and choose the recovery kernel. Then select “root” to get a shell and run fsck or check logs.
  • If the freeze happens only in GNOME: Try switching to a virtual terminal with Ctrl+Alt+F3 (or F2-F6). If that works, the issue is with the display server—restart it with sudo systemctl restart gdm.
  • If the problem persists after all steps: Test your RAM with memtest86+ (install with sudo apt install memtest86+ and run at boot). Faulty RAM is a silent cause of random freezes.

Frequently Asked Questions

Why does my Ubuntu 22.04 freeze randomly?

Random freezes are often caused by overheating, failing RAM, or incompatible graphics drivers. Check your system logs with journalctl -p 3 -xb after a freeze to see the last messages before the crash.

Can I fix slowness without reinstalling?

Yes, most performance issues are fixable by cleaning up disk space, disabling startup apps, and updating drivers. Reinstalling is a last resort.

Is it safe to kill a process that uses high CPU?

Yes, but only if it’s a user application. Avoid killing system processes. Use htop to see the full command line and confirm it’s not a system service.

How do I check if my disk is failing?

Use sudo smartctl -a /dev/sda (install smartmontools) to see S.M.A.R.T. data. Look for Reallocated_Sector_Ct or Pending_Sector values above 0—these indicate failing hardware.

Will switching to a lighter desktop really help?

Yes, GNOME is resource-heavy. Xfce or LXQt use significantly less RAM and CPU, which can make a noticeable difference on older computers.

What is the best way to prevent future freezes?

Keep your system updated, monitor temperatures, maintain at least 10% free disk space, and avoid running too many heavy apps at once. Also consider upgrading RAM if you often run out.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →