Linux Distributions
What Is a Distribution?
A distribution (distro) packages the Linux kernel with a package manager, default software, release cycle, and support model. The kernel is largely the same across distros; what differs is tooling, philosophy, and how quickly packages update.
# Identify your distro
cat /etc/os-release
hostnamectl
# Kernel (same across families at a given version)
uname -r
Major Families
| Family | Package manager | Notable distros | Best for |
|---|---|---|---|
| Debian | apt (dpkg) | Debian, Ubuntu, Mint | Servers, beginners, LTS stability |
| Red Hat | dnf/yum (rpm) | Fedora, RHEL, Rocky, Alma | Enterprise, SELinux-heavy environments |
| Arch | pacman | Arch, Manjaro | Rolling releases, DIY setups |
| SUSE | zypper (rpm) | openSUSE, SLES | Enterprise SAP/IBM stacks |
| Alpine | apk | Alpine Linux | Minimal containers, embedded |
Ubuntu vs. Debian
Debian prioritizes stability and free software. Release cycles are conservative; “stable” means thoroughly tested.
Ubuntu is Debian-based with predictable LTS releases (5 years of standard support, extendable to 10). Broader hardware/driver support and the largest cloud image catalog.
# Ubuntu LTS check
grep VERSION_ID /etc/os-release
lsb_release -cs # codename: jammy, noble, etc.
# Debian version
cat /etc/debian_version
Most cloud providers default to Ubuntu LTS for general-purpose VMs. Debian is preferred when minimalism and upstream purity matter.
Fedora vs. RHEL
Fedora is upstream, cutting-edge, and community-driven — new kernel and toolchain versions land here first.
RHEL (and free clones Rocky Linux, AlmaLinux) targets enterprise: 10-year support windows, certification programs, and paid support. Package versions lag Fedora by months or years.
# RHEL/Rocky major version
cat /etc/redhat-release
# Compare package versions between Fedora and RHEL
dnf info nginx # Fedora
yum info nginx # RHEL 7 legacy
For enterprise job prep, practice on Rocky or Alma — commands mirror RHEL without a subscription.
Arch and Rolling Releases
Arch Linux uses a rolling release model: pacman -Syu continuously updates the system. No major version upgrades — you stay current.
# Arch only
pacman -Syu
pacman -Ss nginx
Trade-off: latest software, but you own breakage from upstream changes. Not recommended for production servers unless your team knows Arch well.
Choosing a Distro
| Goal | Suggested starting point |
|---|---|
| First Linux install | Ubuntu LTS or Linux Mint |
| Homelab / VPS | Debian or Ubuntu LTS |
| Enterprise job prep | Rocky Linux or AlmaLinux |
| Learn internals | Arch Linux or Debian minimal |
| Containers base image | Alpine or distroless (Debian-based) |
| Kubernetes nodes | Ubuntu LTS, RHEL, or Flatcar |
Desktop Environments
Distros may ship GNOME, KDE Plasma, XFCE, or no GUI. Server images are CLI-only:
# Ubuntu — lightweight desktop (optional)
sudo apt update
sudo apt install xfce4
# Check if running under a display server
echo $XDG_SESSION_TYPE # wayland or x11
Install a desktop only when needed — servers should stay headless to reduce attack surface.
Release Models Compared
| Model | Examples | Update frequency | Production fit |
|---|---|---|---|
| Fixed release | Ubuntu, Debian, Fedora | Major every 6–24 months | Excellent with LTS |
| Rolling release | Arch, Tumbleweed | Continuous | Requires active maintenance |
| Immutable | Fedora Silverblue, Flatcar | Atomic image updates | Container/K8s nodes |
Package Manager Quick Reference
# Debian/Ubuntu
sudo apt update && sudo apt install curl
# Fedora/RHEL 8+
sudo dnf install curl
# Arch
sudo pacman -S curl
# Alpine
apk add curl
Best Practices
- Match production distro and major version in dev/staging environments
- Prefer LTS for servers; pin versions in infrastructure-as-code
- Document why non-default repos (PPAs, EPEL) were added
- Verify ISO checksums from official download pages only
Common Mistakes
| Mistake | Consequence |
|---|---|
| Mixing package managers on one system | Broken dependencies, unrecoverable state |
| Using Ubuntu non-LTS in production | Support ends in 9 months |
| Adding random PPAs without review | Unmaintained or malicious packages |
| Assuming RHEL = CentOS commands | CentOS Stream changed; use Rocky/Alma |
Troubleshooting
Wrong package manager on unfamiliar server:
# Detect family
if [ -f /etc/debian_version ]; then echo "Debian family"; fi
if [ -f /etc/redhat-release ]; then echo "Red Hat family"; fi
command -v apt && echo "Use apt"
command -v dnf && echo "Use dnf"
Cloud image vs. desktop confusion: Server images lack GUI packages and may use cloud-init for first-boot config. Check /etc/cloud/ presence.
Production Scenario
A startup runs Ubuntu 22.04 LTS on AWS. They standardize on:
- Base AMI: Official Ubuntu 22.04 from AWS marketplace
- Package policy: Only
apt; no manual.debinstalls in production - Upgrade path: Plan migration to 24.04 LTS during the 22.04 support window
- CI runners: Same 22.04 image to match production glibc and OpenSSL versions
When one developer uses Fedora locally, integration tests fail on OpenSSL version differences — the team adds a devcontainer based on the production image.
Pick fixed release for production servers; understand your family’s package manager and support timeline before committing infrastructure to a distro.