Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Troubleshoot Ubuntu Linux Problems: Step-by-Step

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

If your Ubuntu system is acting up—slow boot, frozen apps, network drops, or kernel panics—the fastest fix is usually a sequence of simple checks: restart the service, check logs, verify disk space, and update packages. Below is a practical, ordered guide to diagnose and resolve most common Ubuntu issues without reinstalling. You'll need a terminal (Ctrl+Alt+T), sudo access, and an internet connection for updates.

What You'll Need

  • A Ubuntu PC (desktop or server) with an admin user account
  • Access to a terminal (Ctrl+Alt+T on desktop)
  • Internet connection for package updates and log lookups
  • Basic familiarity with sudo commands

Step-by-Step

  1. Start with a clean reboot. If the system is unresponsive, press and hold the power button for 5 seconds, then turn it back on. A fresh boot clears temporary memory issues and stops hung processes.
  2. Check disk space. A full root partition causes many bizarre errors. Run df -h in the terminal. If any partition is at 100% or near full, free space by removing old logs (sudo journalctl --vacuum-size=200M) or clearing apt cache (sudo apt clean).
  3. Look at system logs. The journal contains clues for almost every problem. Run journalctl -p 3 -xb to see high-priority errors from the last boot. Look for lines mentioning failed services, hardware errors, or filesystem issues. For a specific app, use journalctl -u service-name (replace with the actual service).
  4. Update your system. Outdated packages cause known bugs. Run sudo apt update then sudo apt upgrade. If the upgrade fails, try sudo apt --fix-broken install to repair dependency issues.
  5. Test hardware health. If you suspect RAM or disk problems, run sudo smartctl -a /dev/sda (replace sda with your disk) to check drive health. For memory, run sudo memtest86+ from the GRUB menu (reboot and hold Shift).
  6. Check network connectivity. If you have no internet, run ping -c 4 8.8.8.8 to test basic connectivity. If that fails, check your interface with ip a and restart networking with sudo systemctl restart NetworkManager (desktop) or sudo systemctl restart systemd-networkd (server).
  7. Reset a problematic application. If a specific app crashes, try resetting its configuration. For example, for GNOME settings, run dconf reset -f /org/gnome/ (this resets all GNOME settings—back up first). For other apps, look in ~/.config for the app folder and rename it (e.g., mv ~/.config/appname ~/.config/appname.bak) to restore defaults.
  8. Reinstall the problematic package. If an app is corrupted, reinstall it: sudo apt purge then sudo apt install . This clears configuration files and re-downloads fresh binaries.
  9. Boot into a previous kernel. If the system fails to boot after a kernel update, restart, hold Shift to enter GRUB, choose “Advanced options for Ubuntu,” and select an older kernel. Once booted, you can remove the bad kernel with sudo apt remove linux-image-.
  10. Check for systemd service failures. Run systemctl --failed to list any failed services. Investigate each with systemctl status and restart or disable as needed.

Common Mistakes

  • Skipping the reboot. Many issues are transient; a reboot often resolves them without further steps.
  • Ignoring disk space. A 100% full / partition can cause apps to crash and the system to freeze. Always check df -h first.
  • Running random commands from forums. Copy-pasting commands you don't understand can make things worse. Stick to official documentation or well-known commands like those above.
  • Not backing up before resetting configs. When you reset an app's configuration, you lose custom settings. Always rename the folder instead of deleting it.
  • Using sudo unnecessarily. Running GUI apps with sudo can corrupt file permissions. Only use sudo for system-level commands.

Tips

  • Create a bootable USB stick with Ubuntu Live—it's invaluable for repairing a system that won't boot.
  • Use journalctl -f to watch logs in real time while reproducing the problem. Open a second terminal and trigger the issue to see live errors.
  • Keep a backup of your /etc directory. Many config files live there; a backup helps you revert changes.
  • Learn the dmesg command (dmesg --level=err) to see kernel-level errors, especially for hardware issues.
  • Regularly run sudo apt autoremove to clean unused packages, preventing dependency clutter.

Troubleshooting

If the steps above don't resolve your issue, try these additional checks:

  • Boot into recovery mode. From GRUB, select “Advanced options” then “Recovery mode.” Choose “fsck” to check filesystems, “network” to enable networking, and “root” to get a root shell for manual fixes.
  • Check for proprietary drivers. If you have graphics or Wi-Fi issues, go to “Software & Updates” > “Additional Drivers” and select a proprietary driver if available.
  • Test with a different user account. Create a new user (sudo adduser test) and log in as that user. If the problem disappears, it's a user configuration issue—reset your original user's settings.
  • Inspect the boot sequence. Run systemd-analyze blame to see which services slow down boot. If one service hangs, disable it with sudo systemctl disable .
  • If all else fails, reinstall Ubuntu while keeping your home folder. During installation, choose “Something else” and mount your existing / partition as /, but do not format it. This preserves your files.

Frequently Asked Questions

How do I fix a frozen Ubuntu system?

Try Ctrl+Alt+F2 to switch to a text console, log in, and run sudo systemctl restart lightdm (or gdm3). If that fails, press Alt+SysRq+R-E-I-S-U-B to safely reboot (hold Alt+SysRq, then press each letter in order, waiting a second).

Why does Ubuntu boot to a black screen?

Usually a graphics driver issue. Boot into recovery mode, select “root,” then run sudo apt purge (if you installed it) and reboot. Alternatively, add nomodeset to the kernel boot parameters in GRUB (press 'e' on the boot entry and add it to the line ending with 'quiet splash').

How do I recover data if Ubuntu won't boot?

Boot from a Ubuntu Live USB, mount your hard drive (e.g., sudo mount /dev/sda1 /mnt), and copy files to an external drive. Use lsblk to identify partitions.

What does “Unable to locate package” mean?

Your package list is outdated. Run sudo apt update first. If the package still isn't found, it may not be in the default repositories—search with apt search or add a PPA.

How do I fix “Sub-process /usr/bin/dpkg returned an error code”?

This often happens after a broken package. Run sudo dpkg --configure -a to fix unfinished installations, then sudo apt --fix-broken install.

Can I revert a system update that broke things?

If you used Timeshift or have a system snapshot, restore it. Otherwise, you can downgrade specific packages with sudo apt install = (check available versions with apt-cache policy ).