Distributions

A distribution (distro) bundles the Linux kernel with software to make a complete, usable operating system.

Because Linux is just a kernel, different teams package it with their own choice of tools, package managers and defaults. Each package is called a distribution, or distro.

Common distributions

DistroFamilyPackage manager
Ubuntu / DebianDebianapt
Fedora / RHELRed Hatdnf / yum
CentOS / RockyRed Hatdnf
Arch LinuxArchpacman
AlpineIndependentapk

On servers and in Docker containers you will mostly meet Ubuntu, Debian and Alpine. The commands in this tutorial work on all of them.

Example

Example Β· bash
# The 'PRETTY_NAME' line tells you exactly which distro you have
grep PRETTY_NAME /etc/os-release
# Output: PRETTY_NAME="Ubuntu 24.04.1 LTS"

When to use it

  • A sysadmin selects RHEL for an enterprise database server because Red Hat provides 10-year security patches.
  • A developer uses Alpine Linux as a Docker base image to keep container images under 10 MB.
  • A security researcher boots Kali Linux to access pre-installed penetration-testing tools during an audit.

More examples

Identify current distribution

Extracts the human-readable distro name from the standard os-release file.

Example Β· bash
grep PRETTY_NAME /etc/os-release
# PRETTY_NAME="Ubuntu 24.04.1 LTS"

Check distro family and version

Shows the full distro metadata including its upstream family used to pick the right package manager.

Example Β· bash
cat /etc/os-release
# NAME="Fedora Linux"
# VERSION_ID="40"
# ID=fedora
# ID_LIKE=rhel

Compare distros in Docker

Illustrates how different distros appear as Docker base images, letting you choose size vs compatibility.

Example Β· dockerfile
# Debian-based (large, many packages)
FROM ubuntu:24.04

# Alpine-based (tiny, musl libc)
FROM alpine:3.20

# Red-Hat-based
FROM fedora:40

Discussion

  • Be the first to comment on this lesson.
Distributions β€” Linux | SoundsCode