Skip to content
Tutorials Center
My learning

Topics

Lesson 3 of 95 ยท Getting Started

Linux Distributions and Unix Heritage

Compare the main Linux distribution families, learn what a distro contains and how to choose one, and understand Linux versus Unix, BSD and macOS.

"Which Linux should I use?" is one of the most asked questions in computing, and it has a simple answer once you know what a distribution actually is. Every distribution runs a Linux kernel and ships mostly the same core tools. What differs is the packaging, the release schedule, the defaults and who stands behind it when something breaks.

This lesson introduces the five big families of distributions (Debian, Red Hat, Arch, SUSE and Alpine), explains what is inside a distribution, gives you a way to choose, and then steps back to look at the history: where Unix came from, how Linux relates to it, and why a Mac's terminal feels familiar but not identical. You will also write a small script that recognizes the family of the system it runs on, which is a real-world need for installers and automation.

What a distribution contains

A distribution ("distro") is a complete operating system assembled around the kernel. The parts are the same everywhere; the choices differ:

  • The Linux kernel, often with distribution-specific patches and a chosen version.
  • The C library and core tools: glibc or musl, GNU coreutils, a shell, grep, sed, tar and the rest.
  • An init system: almost always systemd; some (Alpine, Void, Devuan) use OpenRC, runit or SysV init.
  • A package manager and repositories: the way software is installed, verified and updated.
  • An installer and default configuration: disk layout, firewall, default user, security modules.
  • Optional desktop environments: GNOME, KDE Plasma, Xfce and many more, or none at all on a server.
  • A release model: fixed releases (new version every six months or two years, security fixes in between) or rolling releases (continuous updates, no version numbers).
  • Support and governance: a community, a company, or both.

The main families

Most distributions descend from a few parents. If you know the family, you know the package manager and where files live.

Family Examples Package format and tool Character
Debian Debian, Ubuntu, Linux Mint, Raspberry Pi OS .deb, apt, dpkg Huge repositories, very stable "stable" branch, the most common base for servers and containers. Ubuntu adds a regular release schedule and long-term support (LTS).
Red Hat RHEL, Fedora, Rocky Linux, AlmaLinux, CentOS Stream .rpm, dnf, rpm Enterprise focus, long support periods (up to ten years), SELinux on by default. Fedora is the fast-moving upstream.
Arch Arch Linux, Manjaro, EndeavourOS pacman, AUR Rolling release, minimal base, you assemble the system yourself. Excellent documentation (the Arch Wiki).
SUSE openSUSE Leap and Tumbleweed, SLES .rpm, zypper Strong in Europe and in enterprise, the YaST configuration tool, Btrfs snapshots by default.
Alpine Alpine Linux apk Tiny (a few megabytes), uses musl and BusyBox, very popular as a container base image.

There are other independent lines, such as Gentoo (source-based), NixOS (declarative, reproducible), Slackware (the oldest still maintained) and Void. Package commands differ, as you saw in Packages, Services and Timers, but everything in this course about the shell works on all of them.

Recognizing a family in a script

Installers and setup scripts need to know where they are running. The standard way is the file /etc/os-release, a small file of KEY=value lines that you can source straight into the shell. ID names the distribution and ID_LIKE lists the ones it is derived from, so Ubuntu says ID=ubuntu and ID_LIKE=debian.

Bash Detect the distribution family

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with read or cat), it gets the next line from this box.

The function sources the file inside itself, with local ID= ID_LIKE= so the values do not leak out, then loops over ID followed by ID_LIKE and stops at the first name it knows. Rocky Linux is recognized as Red Hat family through rhel, and Ubuntu as Debian family through debian. The sandbox itself reports debian.

How to choose

Pick by the job, not by taste:

  • Learning and desktop use: Ubuntu, Fedora or Linux Mint. Good hardware support and lots of tutorials.
  • A server you must keep running for years: Debian stable, Ubuntu LTS, or Rocky/AlmaLinux. Fixed releases with long security support.
  • Following enterprise jobs and certifications: Red Hat family (RHEL, Rocky, AlmaLinux).
  • Containers: Debian-slim or Ubuntu for compatibility, Alpine for tiny images (watch for musl differences).
  • Learning how Linux is assembled, or wanting the newest software: Arch or Fedora.
  • Reproducible systems: NixOS.

Practical tips: stay on a version that still receives security updates, check the end-of-support date before you deploy, and prefer one family across your servers so your automation stays simple.

Linux, Unix and BSD

Linux is Unix-like, not Unix. Here is the short history:

  1. 1969-1970s: Unix. Ken Thompson and Dennis Ritchie at Bell Labs create Unix. Its ideas are still with us: everything is a file, small tools that do one job, pipes, a hierarchical file system and a shell. In 1973 Unix is rewritten in C, which makes it portable.
  2. 1977 onward: BSD. The University of California, Berkeley, builds the Berkeley Software Distribution. It adds the C shell, vi, TCP/IP networking and the sockets API. After a lawsuit settled in the 1990s, free descendants appear: FreeBSD, NetBSD, OpenBSD.
  3. 1983-1984: GNU. Richard Stallman starts the GNU project to build a free Unix-compatible system. By 1990 it has compilers, shells and core tools, but its own kernel is not ready.
  4. 1991: Linux. Linus Torvalds writes a kernel and publishes it. Combined with the GNU tools it forms a complete free system. Linux is a new kernel written from scratch, not Unix code.
  5. 1990s-2000s: Unix standards. POSIX defines the common interface of Unix-like systems, which is why a well-written script runs on many of them. Certified "UNIX" systems today include macOS, AIX and HP-UX.
TEXT
 Unix (1969)
   |- BSD (1977) -- FreeBSD, NetBSD, OpenBSD, and Darwin -- macOS, iOS
   |- System V (1983) -- Solaris, AIX, HP-UX
   '- (ideas) -- GNU tools + Linux kernel (1991) -- all Linux distributions

Linux versus Unix and BSD

Linux BSD systems Commercial Unix
Kernel One kernel, many distributions A complete OS (kernel plus tools) in one project Vendor-built (AIX, Solaris)
Tools GNU (long options, many extras) BSD (shorter, stricter) Vendor versions
License GPL (copyleft) BSD (permissive) Proprietary
Typical use Servers, cloud, Android, embedded Firewalls, storage, network gear Legacy enterprise systems

macOS and Windows

macOS is built on Darwin, which has a BSD heritage, so Terminal behaves much like Linux. The tools are BSD versions, though, so options differ: sed -i needs an argument, stat and date take different flags, and some GNU long options do not exist. Windows can run a real Linux kernel through WSL (see Linux on Windows and in the Cloud).

Bash GNU tools versus the portable core

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with read or cat), it gets the next line from this box.

The lesson: GNU options are convenient, but scripts meant for several systems should stick to POSIX tools and options, or detect the system first. See Portability.

Debian (1993) is the community-run grandmother of a large family. Its social contract, its stable/testing/unstable release model and the .deb format with APT (1998) shaped much of what followed. Derivatives include Ubuntu, Linux Mint, Kali, Raspberry Pi OS and Pop!_OS. A new Debian stable comes about every two years and receives long-term support afterwards.

Ubuntu (2004, Canonical) takes Debian's packages and adds a regular schedule: a release every April and October, and a LTS (long-term support) release every two years, supported for five years (more with a paid subscription). Version numbers are the year and month (24.04), and each release has an alliterative code name such as Focal Fossa (20.04), Jammy Jellyfish (22.04) and Noble Numbat (24.04). Editions: Desktop, Server, Core (IoT), plus flavours such as Kubuntu (KDE) and Xubuntu (Xfce). It is popular for personal computers, cloud servers, education, IoT and machine-learning workstations because its documentation and community are huge.

Fedora is Red Hat's community distribution, with a new release about every six months and new technology (a recent kernel, Wayland, new file systems) arriving there first. Its editions target different uses: Workstation (desktop), Server, IoT, CoreOS (automatically updating, container-focused hosts) and Silverblue (an immutable desktop where the base system is replaced as a whole and apps run as Flatpaks). Spins offer other desktops (KDE, Xfce, LXQt). Fedora feeds ideas into RHEL, and downstream rebuilds (Rocky, AlmaLinux) follow RHEL.

CentOS was the free rebuild of RHEL for many years (2004 to 2020). In 2014 Red Hat took over sponsorship; in 2020 it announced that CentOS Linux would end and CentOS Stream would become the rolling preview of the next RHEL minor release. Many former CentOS users moved to Rocky Linux or AlmaLinux. The tools (yum, dnf, rpm, /etc/sysconfig/network-scripts on older versions) remain the same across this family.

Arch Linux (2002) is a rolling release with a minimalist, do-it-yourself philosophy: you assemble the system from a base, use pacman and read the wiki (one of the best documentation sites of any distribution). Derivatives such as Manjaro and EndeavourOS install it with a graphical installer; BlackArch targets security testing.

Kali Linux is a Debian-based distribution maintained for penetration testing and digital forensics. It ships hundreds of security tools, can boot as a live system from USB, runs in a VM or on WSL, and supports ARM boards. Use it only on systems you own or have written permission to test; its default configuration is not meant for everyday use.

Alpine (musl libc, BusyBox, OpenRC) is tiny and the base of many container images. SUSE (openSUSE, SLES) is strong in Europe and enterprise with the YaST and zypper tools.

Classification by purpose

Need Typical choice
Learn Linux or a first desktop Ubuntu, Linux Mint, Fedora Workstation
Stable server for years Debian stable, Ubuntu LTS, RHEL and its rebuilds
Newest software Fedora, Arch, openSUSE Tumbleweed
Small containers Alpine, Debian slim, distroless images
Security testing Kali, Parrot
Resource-poor hardware Lubuntu, antiX, Alpine
Immutable or appliance-style systems Fedora Silverblue and CoreOS, NixOS

The layers of a Unix-like system

Unix is often drawn as four layers, and Linux follows the same pattern:

  1. Hardware: CPU, memory, disks, network cards.
  2. Kernel: schedules processes, manages memory, drives devices, enforces permissions and offers system calls to programs.
  3. System programs and libraries: the shell, the core utilities (ls, grep), the C library (glibc or musl) and tools such as the package manager.
  4. Applications: browsers, editors, databases and your own programs.

Its defining properties are that it is multiuser (many accounts with separate permissions can work at once) and multitasking (many processes share the CPUs), plus portability (rewritten in C in 1973, so it could be moved between machines). In outline: Unix began in 1969 at Bell Labs, was rewritten in C in 1973, spread to universities in the 1970s (BSD), was commercialised in the 1980s (System V, AIX, Solaris, HP-UX), and was standardised as POSIX and the Single UNIX Specification in the 1990s. Today Linux dominates servers, cloud, supercomputers (every machine on the TOP500 list runs it), Android phones and embedded devices, while Unix proper survives in telecommunications, banking and other long-lived enterprise systems, and BSD in networking appliances and game consoles.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. Which package manager belongs to the Debian family?

    Debian, Ubuntu and Mint use .deb packages with apt and dpkg. dnf is Red Hat family, pacman is Arch and zypper is SUSE.
  2. 2. What does ID_LIKE=debian in /etc/os-release tell a script?

    ID names the distribution (for example ubuntu). ID_LIKE lists the parents. A script can fall back to the parent's behavior when it does not know the exact ID.
  3. 3. Which statement about Linux and Unix is correct?

    Linus Torvalds wrote the kernel from scratch in 1991. It is Unix-like and mostly POSIX-compatible, but it does not contain Unix source code.
  4. 4. Why is Alpine Linux popular for container images?

    Alpine's base image is only a few megabytes. The trade-off is musl instead of glibc, which can cause compatibility differences.
  5. 5. A script that works on Linux fails on macOS with sed -i 's/a/b/' file. What is the likely cause?

    macOS ships BSD sed, where -i requires a suffix argument. GNU sed treats the suffix as optional. Portable scripts avoid -i or write to a temporary file.

Summary

  • A distribution is a kernel plus libraries, tools, an init system, a package manager, defaults and a release policy.
  • The main families are Debian (apt), Red Hat (dnf/rpm), Arch (pacman), SUSE (zypper) and Alpine (apk); knowing the family tells you how to install and update software.
  • Choose by the job: long-term stability for servers, current software for desktops, tiny images for containers.
  • /etc/os-release (ID, ID_LIKE, VERSION_ID) is the standard way for scripts to identify the system.
  • Unix started at Bell Labs in 1969; BSD, GNU and Linux grew from its ideas. Linux is Unix-like and was written from scratch; macOS descends from BSD.
  • GNU and BSD tools differ in options, so portable scripts stick to POSIX features.

Next: Shell Basics