10 common Linux issues and how to fix them banner
Linux troubleshooting

10 Common Linux Issues and How to Fix Them

Linux problems are much easier to fix when you follow a clean troubleshooting order. This guide covers ten common issues, the commands to confirm them, example output and safe next steps. No panic typing required.

On this page

Quick issue list

Issue 1

Disk space is full

A full filesystem can break websites, databases, backups, package updates and log writing. Start by confirming which filesystem is full.

df -h

Example output:

Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        80G   78G  1.2G  99% /
/dev/vdb1       200G  120G   80G  60% /backup

Find large directories

du -xhd1 / | sort -h

Find large files

find / -xdev -type f -size +500M -exec ls -lh {} \; 2>/dev/null
Do not delete blindly from system directories. Identify what the file is, what owns it and whether it is safe to remove.

Related: Linux High Disk Usage Troubleshooting and du and df Cheat Sheet.

Issue 2

A service has failed

When a service is down, check status first, then logs. The logs usually tell you whether the cause is a bad config, missing file, port conflict or dependency issue.

systemctl status nginx
journalctl -u nginx -n 80 --no-pager

Example output:

Active: failed (Result: exit-code)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

Fix the logged problem, then restart the service:

systemctl restart nginx
systemctl status nginx

Related: systemd Guide and systemctl Cheat Sheet.

Issue 3

Permission denied errors

Permission issues are usually caused by wrong ownership, missing execute permission on a directory, or a file mode that is too restrictive.

ls -lah /path/to/file
namei -l /path/to/file

Example output:

-rw------- 1 root root 1.2K May  5 10:10 config.php

If the file should belong to a web user, fix ownership and permissions carefully:

chown user:user config.php
chmod 640 config.php
Avoid using chmod 777 as a shortcut. It often hides the real issue and weakens security.

Related: Understanding Linux Permissions, Permissions Cheat Sheet and Permissions Builder.

Issue 4

DNS is not working

DNS issues can look like website outages, email problems or SSH failures. Test the record directly before assuming the service is down.

dig example.com A +short
dig example.com MX +short
dig @1.1.1.1 example.com A +short

Example output:

93.184.216.34

If one resolver returns an old value and another returns a new one, the issue may be cache or propagation. If all resolvers return nothing, check the zone and nameservers.

Related: dig Command Guide, dig Cheat Sheet and dig Command Builder.

Issue 5

SSH is failing

SSH failures normally fall into four groups: DNS, port access, service state or authentication.

ssh -v user@example.com
nc -vz example.com 22
systemctl status sshd

Common clues:

Connection timed out     # firewall, routing or wrong host
Connection refused       # SSH not listening on that port
Permission denied        # username, password or key issue

Related: Connect to cPanel via SSH using PuTTY and Basic Networking Commands.

Issue 6

High load or CPU usage

High load means the system has more work waiting than it can process quickly. CPU is one cause, but disk I/O and stuck processes can also push load up.

uptime
top
ps aux --sort=-%cpu | head

Example output:

load average: 12.44, 10.21, 8.91
USER       PID %CPU %MEM COMMAND
mysql     1842 95.1 18.2 mysqld

If one process dominates, inspect its logs and workload before restarting it. A restart may clear the symptom but not the cause.

Related: Top 10 Linux Commands for Troubleshooting Websites.

Issue 7

Memory pressure

Low available memory can cause swapping, slow applications and killed processes. Check memory and swap together.

free -h
vmstat 1 5
ps aux --sort=-%mem | head

Example output:

              total        used        free      available
Mem:           7.7G        7.1G        180M        290M
Swap:          2.0G        1.8G        200M

If swap is heavily used and available memory is low, identify the largest processes and check whether this is expected workload or a leak.

Issue 8

Inodes are full

A filesystem can run out of inodes even when disk space remains. This usually happens when there are huge numbers of tiny files.

df -ih

Example output:

Filesystem     Inodes IUsed IFree IUse% Mounted on
/dev/vda1        5.0M  5.0M  1.2K  100% /

Find directories with lots of files:

find /home/user -xdev -type f | sed 's#/[^/]*$##' | sort | uniq -c | sort -nr | head

Common culprits include cache directories, session files, temporary uploads and mail queues.

Issue 9

Website returns 500 or 502

A 500 usually points to an application or server-side error. A 502 often means the frontend cannot get a valid response from the backend.

curl -I https://example.com
tail -n 100 /usr/local/apache/logs/error_log
journalctl -u nginx -n 100 --no-pager

Example output:

HTTP/2 500
PHP Fatal error: Uncaught Error: Call to undefined function

Check the relevant web server, PHP and application logs. For cPanel servers, also check domain logs and user-level error logs.

Related: cPanel Log Locations, cPanel Domlog Guide and Apache Log Analysis Cheat Sheet.

Issue 10

Package updates fail

Package failures are commonly caused by network problems, repository issues, locks, broken dependencies or a full disk.

# RHEL, AlmaLinux, Rocky Linux
dnf clean all
dnf makecache
dnf update

# Debian or Ubuntu
apt update
apt upgrade

If package tools report lock errors, check for another running update process before removing lock files.

ps aux | grep -E "dnf|yum|apt"
Do not remove package manager locks until you are sure no update process is actively running.
FAQ

Frequently Asked Questions

What is the first command to run when Linux has a problem?

Start with a command that confirms the symptom. For general server issues, useful first checks are uptime, df -h, systemctl status, journalctl -xe and top or htop.

How do I fix a Linux service that has failed?

Check systemctl status service-name, read logs with journalctl -u service-name, fix the logged error, then restart the service with systemctl restart service-name.

How do I troubleshoot high disk usage on Linux?

Use df -h to identify the full filesystem, du -xhd1 to find large directories, find to locate large files, and lsof +L1 to check deleted files still held open.

How do I troubleshoot DNS problems on Linux?

Use dig, resolvectl status, ping and curl. Check whether DNS fails globally, only on one resolver, or only from the affected server.

How do I fix permission denied errors?

Check ownership with ls -lah, confirm directory execute permissions, use chmod for permissions and chown for ownership. Avoid chmod 777 unless you understand the risk.

$ practise_next --topic permissions

Practise this next

Turn the guide into practice with a related quiz, builder, cheat sheet or learning path.