Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Troubleshooting and Logs

Most Linux problems are diagnosable if you follow a repeatable process. This chapter gives you a practical triage workflow and the first tools to reach for.

A Simple Triage Workflow

  1. Identify what failed (service, network, audio, app).
  2. Capture exact error output.
  3. Check recent logs.
  4. Make one change at a time.
  5. Retest and record results.

Avoid changing many settings at once. It hides the real cause.

First Commands to Run

# Current boot logs
journalctl -b --no-pager

# Error priority logs
journalctl -p err -b --no-pager

# Failed services
systemctl --failed

# Kernel messages
dmesg -T | tail -n 100

Service-Level Troubleshooting

When a service is failing:

systemctl status servicename --no-pager
journalctl -u servicename -b -n 200 --no-pager

Read for:

  • Missing file paths
  • Permission errors
  • Port conflicts
  • Invalid config syntax

If a service file was recently edited, verify syntax first, then restart:

sudo systemctl daemon-reload
sudo systemctl restart servicename

Network Troubleshooting Starter

nmcli device status
ip address
ip route
ping -c 3 1.1.1.1
resolvectl status
journalctl -u NetworkManager -b --no-pager

Interpretation:

  • Can ping IP but not domain: likely DNS issue.
  • No default route: gateway or interface config issue.
  • Device unmanaged: NetworkManager profile mismatch.

Audio Troubleshooting Starter

pactl list short sinks
pactl info
aplay -l
systemctl --user status pipewire pipewire-pulse wireplumber --no-pager

If audio disappears after updates, verify default sink and restart user audio services.

Where Logs Live

  • Journald database: use journalctl
  • Traditional logs: /var/log
  • Package manager logs: distro-dependent, often under /var/log

Useful paths to remember:

  • /var/log/syslog or /var/log/messages
  • /var/log/auth.log or secure/authentication logs
  • /var/log/pacman.log, /var/log/dnf.log, or apt history logs

Symptom-Based Quick Playbooks

System Is Slow or Freezing

top
free -h
df -h
journalctl -p err -b --no-pager

Check for memory pressure, full filesystems, and repeated service errors.

Boot Takes Too Long

systemd-analyze
systemd-analyze blame | head -n 20

This quickly shows slow units during startup.

Package Update Broke Something

  • Check package manager history logs.
  • Reboot once to rule out stale session state.
  • Identify the exact package update before rolling back or pinning.

Capturing a Useful Support Report

Create a minimal report when you need outside help:

uname -a > system-report.txt
lsb_release -a >> system-report.txt 2>/dev/null || cat /etc/os-release >> system-report.txt
systemctl --failed >> system-report.txt
journalctl -p err -b --no-pager >> system-report.txt

Attach exact command outputs with timestamps when possible.

Sharing Errors for Help

When asking for support, include:

  • The command you ran
  • Full error output
  • Distribution and version
  • What changed right before the issue started

Never post secrets, API keys, or private credentials.

Key takeaways

  • Linux troubleshooting is a process, not guesswork.
  • Start with status, logs, and one controlled change at a time.
  • Journal and kernel logs usually explain failure causes.
  • Clear error reports dramatically improve support outcomes.
Last change: