Linux 66
Server setup and day-to-day commands by distribution and version, with the output they print.
- Linux 5.10 and 5.15 Reach End of Life: Check Your Server
kernel.org ended the 5.10 and 5.15 longterm series on 2026-12-01. See which package your running kernel came from and judge it by your distribution's dates.
Ubuntu 22.04 · Debian 12·11 · Rocky Linux 9 containers (package download only) · 2026-12 - Debian 13.8 Update: Check Your Version and Apply It
Check your Debian version and trixie repositories, preview package updates and holds with APT, then verify the installed release and running kernel.
Debian 13.7 and 13.8 (Docker) · APT 3.0.4 · 2026-11 - AlmaLinux 10.3 ModSecurity: check before moving to CRS 4
ModSecurity is back in AlmaLinux 10.3 and the rules jump from CRS 3.3.5 to 4.22.0. Check versions and how rules load, then trial detection-only mode first.
AlmaLinux 10.3 AppStream repository queried from an AlmaLinux 9.9 container · mod_security 2.9.14 · mod_security_crs 4.22.0 - Debian 12 linux-image-6.1.0-55 freezes - boot 6.1.0-54
If Debian 12 hangs on linux-image-6.1.0-55 with an ext4 NULL pointer Oops, boot 6.1.0-54 from GRUB, then upgrade to the fixed 6.1.192-2 (6.1.0-56).
Debian 12.15 (Docker) · repository version checks only (no kernel boot) · 2026-11 - Check a systemd timer OnCalendar value before installing it
Run systemd-analyze calendar to see the normalized form and next run time of an OnCalendar value before it goes into a unit, and tell parse errors from never.
Ubuntu 24.04.5 · systemd 255.4-1ubuntu8.18 (time zone Asia/Seoul) - Check sshd_config with sshd -t before you reload
Catch sshd_config typos with sshd -t before you reload. Covers real error messages, exit codes, Match block checks, and -T for the effective values.
Ubuntu 24.04.5 · OpenSSH 9.6p1 (openssh-server 1:9.6p1-3ubuntu13.20) - Find the Boot Bottleneck with systemd-analyze blame
Read systemd-analyze time, blame and critical-chain output, and use critical-chain to tell which slow units on the blame list actually delayed the boot.
Ubuntu 24.04.5 LTS · systemd 255 (255.4-1ubuntu8) - Find the process the OOM killer killed on Ubuntu 24.04
Search journalctl -k and dmesg for OOM killer records when a service vanishes, then read the victim and whether a system shortage or a cgroup limit caused it.
Ubuntu 24.04.5 LTS · systemd 255 · Linux 6.8.0-147 (log line shapes from the kernel 6.8 format strings) - Test the fail2ban sshd filter with fail2ban-regex
Count how many auth log lines the sshd filter catches before you enable a jail, then check the missed lines and how each mode changes the result.
Ubuntu 24.04 · fail2ban 1.0.2 (package unpacked, only fail2ban-regex run) - Replace a failed disk when mdadm RAID1 shows [U_] (degraded)
Read [U_] and (F) in /proc/mdstat, replace the dead disk with fail, remove and add, then watch the resync run. Based on the mdadm man page and kernel.org wiki.
mdadm 4.3 man page · Linux RAID wiki (kernel.org) · 2026-10 - Fix 403 Forbidden on a Web Folder with SELinux Labels on Rocky 9
Permissions look right but a new folder returns 403? Check the file label with ls -Z, then make it permanent with semanage fcontext and restorecon.
Rocky Linux 9 · based on RHEL 9 SELinux docs · 2026-10 - certbot "Timeout during connect" — Check Port 80
When certbot fails with "Timeout during connect (likely firewall problem)", find where port 80 is blocked by testing from inside the server, then from outside.
Ubuntu 24.04.5 · Nginx 1.24.0 · Let's Encrypt official docs · 2026-10 - Test HTTPS on Nginx with a Self-Signed Certificate
Create a self-signed certificate with openssl, attach it to Nginx, and see what curl reports with the self-signed certificate error, -k and --cacert.
Ubuntu 24.04 · nginx 1.24.0 · OpenSSL 3.0.13 · curl 8.5.0 - Open a Port with firewalld on Rocky Linux 9
Add a port with firewall-cmd --permanent, apply it with --reload, and verify it. If Connection refused remains, use ss to check whether anything is listening.
firewalld docs and RHEL 9 docs (same family as Rocky 9) · 2026-10 - GitHub Actions macos-14 runner retired on November 2, 2026
The GitHub Actions macos-14 retirement date was Nov 2, 2026, and Nov 23 for Azure DevOps Intel images. Find leftover labels and move to macos-15 or newer.
Ubuntu 24.04 (Docker) · GNU grep 3.11 · GitHub official changelog and runner-images notice · 2026-12 - Verify fstab with findmnt before you reboot
Use findmnt --verify to catch missing UUIDs and mount points in fstab before a reboot. It misses mistyped options and a missing nofail, so check those by hand.
Ubuntu 24.04.5 LTS · util-linux 2.39.3 (findmnt) - Find setuid files and file capabilities: why ping has no setuid
List setuid binaries with find -perm -4000 and file capabilities with getcap -r /. Ubuntu 24.04 vs Rocky 9, and two ways ping works without setuid.
Ubuntu 24.04.5, Rocky Linux 9 (Docker) · 2026-10 - nginx worker_connections are not enough: tuning and keepalive
Fix nginx "worker_connections are not enough": raise worker_connections, fit worker_rlimit_nofile to the hard limit, check upstream keepalive (1.29.7+).
nginx 1.30.6 (Docker nginx:stable) · 2026-10 - Fix Rocky 9 dnf "repomd.xml GPG signature verification error"
Rocky 9 dnf "repomd.xml GPG signature verification error: Bad GPG signature" means metadata and signature do not match. Run dnf clean all, then suspect a proxy.
Rocky Linux 9.3 (Docker) · dnf 4.14.0 · gnupg2 2.3.3 · 2026-10 - Fix "System has not been booted with systemd as init system"
systemctl says "System has not been booted with systemd" when PID 1 is not systemd. Start services directly in containers; on WSL, enable it in wsl.conf.
Ubuntu 24.04 · systemd 255.4 · nginx 1.24.0 (Docker) · WSL official docs · 2026-10 - Fix "setlocale: LC_ALL: cannot change locale" on Ubuntu 24.04
Ubuntu "setlocale: LC_ALL: cannot change locale" means the locale you set was never generated. Check with locale -a, then run locale-gen or switch to C.UTF-8.
Ubuntu 24.04 (Docker) · locales 2.39-0ubuntu8.9 · 2026-10 - Fix "sudo: unable to resolve host" after a hostname change
"sudo: unable to resolve host" after renaming a server means /etc/hosts lacks the new name. Make the 127.0.1.1 line match hostname and confirm with getent.
Ubuntu 24.04 · sudo 1.9.15p5 (Docker) · 2026-10 - Fix resize2fs "Bad magic number in super-block" on XFS
resize2fs "Bad magic number in super-block" means the target is not ext4, usually XFS. Check the type with df -hT, then run xfs_growfs on the mount point.
Ubuntu 24.04 (Docker) · e2fsprogs 1.47.0 · xfsprogs 6.6.0 · 2026-10 - Fix "/bin/bash^M: bad interpreter" (CRLF line endings)
Bash "bad interpreter" (on Ubuntu 24.04: "required file not found") means CRLF line endings. Strip \r with sed, then pin LF in .gitattributes.
Ubuntu 24.04 · bash 5.2.21 · Rocky 9.3 · bash 5.1.8 (Docker) · 2026-10 - Fix Rocky 9 nginx bind() to 8081 failed (13: Permission denied)
Rocky 9 nginx "bind() to 0.0.0.0:8081 failed (13: Permission denied)": if SELinux is enforcing and logs a name_bind AVC, label the port http_port_t.
Rocky Linux 9 · nginx 1.20.1 · policycoreutils 3.6 (Docker · SELinux off) · RHEL 9 SELinux docs · 2026-10 - "umount: target is busy" — find the process holding the mount
"umount: target is busy" means a process has its working directory or an open file on that mount. Find it with fuser -vm or lsof +f, stop it, avoid umount -l.
Ubuntu 24.04 · util-linux 2.39.3 · lsof 4.95.0 · psmisc 23.7 · 2026-10 - Fix httpd AH00558 Could not reliably determine FQDN on Rocky 9
Silence AH00558 on Rocky 9 httpd with one global ServerName file in /etc/httpd/conf.d/. A VirtualHost ServerName is not enough; an FQDN hostname also works.
Rocky Linux 9.8 (Docker rockylinux:9) · httpd 2.4.62 · 2026-10 - Fix nginx 502 php-fpm www.sock failed (13: Permission denied)
nginx 502 with www.sock failed (13: Permission denied) means the worker user cannot write to the PHP-FPM socket. Add it to listen.acl_users or set listen.owner.
Rocky Linux 9.8 (Docker rockylinux:9) · nginx 1.20.1 · PHP-FPM 8.0.30 · 2026-10 - SSH "REMOTE HOST IDENTIFICATION HAS CHANGED": verify, then fix
SSH "REMOTE HOST IDENTIFICATION HAS CHANGED": the host key differs from known_hosts. Verify the fingerprint out of band, then run ssh-keygen -R.
Ubuntu 24.04 (Docker) · OpenSSH 9.6p1 · 2026-10 - systemd-run MemoryHigh vs MemoryMax: throttle or OOM kill?
A 400MB allocation under systemd-run --scope with MemoryHigh or MemoryMax at 256M. With swap both finished; without swap High stalled and Max was OOM-killed.
Ubuntu 24.04 · systemd 255 · kernel 6.8 · cgroup v2 · 2026-10 - Fix apt "E: Unable to locate package" on Ubuntu 24.04
"E: Unable to locate package" means no apt update, universe disabled, a wrong name, or a package missing from 24.04. Tell them apart with apt-cache policy.
Ubuntu 24.04.5 · apt 2.8.3 (Docker) · 2026-10 - Enable HTTPS on Rocky Linux 9 httpd with mod_ssl
On Rocky 9, mod_ssl plus an httpd restart opens 443 with a self-signed localhost.crt. Swap in your certificate via two ssl.conf lines and check httpd -t.
Rocky Linux 9.8 (Docker rockylinux:9) · httpd 2.4.62 · mod_ssl 2.4.62 · 2026-10 - Pre-install crisis diagnostic tools on Ubuntu 24.04 and Rocky 9
Install sysstat, bpftrace, bcc and perf before an outage. Package names, versions, disk space and sar collection defaults compared on Ubuntu 24.04 and Rocky 9.
Ubuntu 24.04.5, Rocky Linux 9.8 (Docker) · 2026-10 - Fix SSH "UNPROTECTED PRIVATE KEY FILE" (permissions 0644)
SSH "UNPROTECTED PRIVATE KEY FILE" (0644 too open) means others can read your key, so ssh ignores it. Run chmod 600, or copy the key if you cannot chmod it.
Ubuntu 24.04 (Docker) · OpenSSH 9.6p1 · 2026-10 - Verify installed files against packages: debsums and rpm -V
Check packaged files with debsums or dpkg --verify on Ubuntu and rpm -V on Rocky 9. A changed binary, config file and deleted file show what each reports.
Ubuntu 24.04 · debsums 3.0.2.1 · Rocky Linux 9 · rpm 4.16.1.3 (Docker) · 2026-10 - Nginx 403 Forbidden — Tell Permission Errors from Index Errors
Two error.log messages explain a 403. Find the blocking directory with namei -l for Permission denied; add an index or autoindex when the index is forbidden.
Ubuntu 24.04.5 · Nginx 1.24.0 (worker user www-data) - Fix Rocky 9 dnf "Failed to set locale, defaulting to C.UTF-8"
Rocky 9 dnf warns "Failed to set locale, defaulting to C.UTF-8" when LANG or LC_ALL names a missing locale. Install a glibc-langpack or use C.UTF-8.
Rocky Linux 9.3 · dnf 4.14.0 · glibc 2.34 (Docker) · 2026-10 - Squid proxy: allow only your subnet, check 403 TCP_DENIED
Limit Squid to your subnet with acl src and http_access, keep the default protection rules, and check curl -x (200/403) and TCP_DENIED. Wrong order blocks all.
Ubuntu 24.04 · Squid 6.14 (Docker) · curl · 2026-10 - Fix apt "E: dpkg was interrupted" with dpkg --configure -a
Ubuntu apt "dpkg was interrupted" means an install stopped halfway. Check no other apt runs, finish it with sudo dpkg --configure -a, then rerun the install.
Ubuntu 24.04 (Docker) · apt 2.8.3 · dpkg 1.22.6 · 2026-10 - systemd-analyze security from 9.4 to 1.9: what breaks
Harden a systemd unit in 12 steps while scoring it with systemd-analyze security --offline. From 9.4 down to 1.9, see where writes and chown started to fail.
Ubuntu 24.04 · systemd 255 · 2026-10 - Fix apt "Key is stored in legacy trusted.gpg keyring" warning
apt warns "Key is stored in legacy trusted.gpg" when a repo key is in the old shared keyring. Export it to /etc/apt/keyrings, add signed-by, delete the old key.
Ubuntu 24.04 · apt 2.8.3 · gpg 2.4.4 (Docker) · 2026-10 - PHP-FPM pm.max_children Tuning: server reached pm.max_children
Fix server reached pm.max_children: read listen queue on the FPM status page, measure one worker's memory, and size max_children to the RAM PHP can use.
PHP 8.3.36 (php:8.3-fpm Docker) · Ubuntu 24.04 php8.3-fpm 8.3.6 (Docker) · 2026-10 - Tune net.core.somaxconn: Listen Backlog and ss Recv-Q/Send-Q
Before raising net.core.somaxconn, read ss -ltn Recv-Q/Send-Q and nstat ListenOverflows to see if the accept queue overflows. Raise the app backlog too.
Ubuntu 24.04 (kernel 6.8) · Docker 29.9.2 · python:3.12-slim · nginx 1.30.6 · 2026-10 - Enable the Rocky Linux 9 security repo (not in updateinfo)
Rocky 9's security repo ships disabled in rocky-repos 9.8. How to enable it, what it holds, and why dnf --security misses it: it has no updateinfo metadata.
Rocky Linux 9.8 (rocky-repos 9.8-1.2) · dnf 4.14 (Docker) · 2026-10 - Fix Rocky 9 dnf "Error: Unable to find a match"
Rocky 9 dnf "Error: Unable to find a match" means no enabled repo has that name. Check EPEL, CRB, command names, and excludes with repolist and provides.
Rocky Linux 9.3 · dnf 4.14.0 · epel-release 9-10 (Docker) · 2026-10 - Rocky 9 "Hash algorithm SHA1 not available": third-party repos
Rocky 9 "Hash algorithm SHA1 not available" means a third-party package is signed with SHA-1. Get the vendor's new key before you lower the crypto policy.
Rocky Linux 9 (Docker) · rpm 4.16.1.3-40 · crypto-policies 20260224 · 2026-10 - Check an ext4 image with a damaged superblock using e2fsck
Practice on an image file: read e2fsck -fn output and exit codes, then find a backup superblock and use -b to check and repair when the primary one is damaged.
Ubuntu 24.04.5 LTS · e2fsprogs 1.47.0 · ext4 image file (300M) - How to Set Up Nginx Basic Auth with htpasswd on Ubuntu 24.04
Set up Nginx auth_basic with htpasswd on Ubuntu 24.04, pick a hash (the Nginx docs say not to use {SHA}), and tell 401, 403 and 500 apart by the error log.
Ubuntu 24.04 · nginx 1.24.0 (Docker) · 2026-10 - dnf needs-restarting -r: reboot needed after update? (Rocky 9)
After a dnf update on Rocky 9, dnf needs-restarting -r exits 1 when a reboot is required; this covers which packages count and how to find services to restart.
Rocky Linux 9.3 (Docker) · dnf-plugins-core 4.3.0-26.el9 · 2026-10 - Fix "Failed to download metadata for repo" in dnf on Rocky 9
Read the repo ID and URL from the error, clear the cache, then check the failing URL with curl to tell a mirror 404, a missing signature file and a proxy error.
DNF docs (conf_ref · command_ref) · EPEL issue #264 · as of 2026-10; not run on Rocky 9 - How to check unattended-upgrades applied updates (Ubuntu 24.04)
After a USN is published, confirm the fix landed using the fixed version, apt-cache policy, a dry run and the logs, including a dry-run message that misleads.
Ubuntu 24.04 (Docker) · unattended-upgrades 2.9.1+nmu4ubuntu1 · 2026-10 - Ubuntu 24.04 SSH port won't change (ssh.socket)
Port is set in sshd_config and ssh is restarted, but port 22 still listens. ssh.socket owns the port. How to check, and the order that keeps you connected.
Ubuntu 24.04.5 · openssh-server 1:9.6p1-3ubuntu13.20 · systemd 255 (read-only checks + official docs) - Allow SSH in ufw before you enable the firewall
Running ufw enable first over SSH can lock you out. Add the SSH rule, check pending rules, enable, read status verbose, and recover from a lockout.
Ubuntu 24.04 · based on the official ufw docs · 2026-10 - Extend an LVM logical volume into the free space of its VG
Read VFree from vgs, then grow the logical volume and its ext4 file system with one lvextend -r -l +100%FREE line. Covers XFS and the case where VFree is 0.
Ubuntu 24.04 · lvm2 2.03.16 · e2fsprogs 1.47.0 · ext4 on loop devices - Fix apt "Could not get lock /var/lib/dpkg/lock-frontend"
Find which process holds the dpkg lock, make apt wait for it, leave the lock file alone, and run dpkg --configure -a only after a run was truly interrupted.
Ubuntu 24.04.5 LTS · apt 2.8.3 · dpkg 1.22.6 - Find Out Why a cron Job Is Not Running — Logs, PATH and %
A job works in the terminal but not from cron. Read the log to see if cron started it, then check PATH, %, permissions, a missing newline and the user field.
Ubuntu 24.04.5 · cron 3.0pl1-184ubuntu2 (man pages and binary checked) · environment reproduced with env -i - Find why SSH says Permission denied (publickey)
Read ssh -v to see which key was offered, then use the sshd log lines (Authentication refused, Failed publickey) to find permission, user or key-line problems.
Ubuntu 24.04 · OpenSSH 9.6p1 (reproduced with a separate sshd) - Find what is using the space when a disk is full
Find the full file system with df, narrow down big files with du and find, then handle space that does not come back after a delete and inode exhaustion.
Ubuntu 24.04.5 LTS · coreutils 9.4 · lsof 4.95.0 · ext4 loop file system - Fix "Could not calculate the upgrade" on Ubuntu 24.04 to 26.04
Fix "Could not calculate the upgrade" (24.04 to 26.04): find the Broken package in /var/log/dist-upgrade/apt.log, the known lintian case and its workaround.
Ubuntu 24.04 → 26.04 · Ubuntu docs and Launchpad reports, 2026-10 - See which process is listening on a port
List listening TCP sockets with their processes, narrow to one port, and check that firewalld lets that port through.
ss (iproute2) · Ubuntu 24.04 output · firewalld per RHEL 9 and firewalld docs (same family as Rocky 9) - Check how much disk the systemd journal uses and shrink it
Check how much disk the journal uses, delete old files with vacuum, pin a size limit with a drop-in file, and find the units that fill the journal.
Ubuntu 24.04 · systemd 255 · settings per freedesktop.org journald.conf(5) and journalctl(1) - Put Nginx in front of an app as a reverse proxy
Send one host name to an app on a local port, pass the client address along, and tell a proxy 502 apart from an app error.
Ubuntu 24.04.5 LTS · nginx 1.24.0 · Python 3 http.server (test app) - Write a logrotate config and test it before using it
Write a logrotate config for an app log, preview it with -d, force a run with -f and a state file, and check the result. Covers copytruncate versus postrotate.
logrotate 3.21.0 · Ubuntu 24.04 · systemd 255 - Find why a systemd service is failed
Read the Active and status lines of systemctl status, check the log from just before the failure, and fix 203/EXEC and "start request repeated too quickly".
Ubuntu 24.04 · systemd 255 (reproduced with transient units) - Install Nginx and set the server name
Install Nginx from the Ubuntu repository, set the default site to your host name, then test the config and reload without dropping connections.
Ubuntu 24.04.5 LTS · nginx 1.24.0 - Fix Nginx proxy blocked by SELinux on Rocky Linux 9
Tell whether a 502 and a Permission denied in error.log come from SELinux, fix it with a boolean, and label a custom document root.
Rocky Linux 9 · per RHEL 9 SELinux documentation · 2026-10