Linux Sysadmin · Lesson 15 · 20 min

Meet the cousins: Alma, Amazon Linux & more

This course uses Rocky and Ubuntu, the heads of the two big families. At work, and in the cloud, you'll also meet their cousins. The good news: once you know which family a distro belongs to, you already know 95% of it. This lesson covers the differences that trip people up.

You will learn

  • The family tree: who is built from whom
  • AlmaLinux (Rocky's twin) and Amazon Linux 2023 (Red Hat family, with surprises)
  • Debian, Fedora and Alpine, and which images you'll see in containers
  • How a script can tell which family it's running on

The family tree

Red Hat family (.rpm, dnf) ├── Fedora ← fast-moving, new every ~6 months; tomorrow's RHEL is tested here │ ├── CentOS Stream ← the preview of the next RHEL update │ │ └── RHEL ← Red Hat Enterprise Linux: paid, supported │ │ ├── Rocky Linux ← free rebuild of RHEL (this course) │ │ ├── AlmaLinux ← free rebuild of RHEL │ │ └── Oracle Linux ← Oracle's rebuild │ └── Amazon Linux 2023 ← AWS's own distro, built from Fedora └── (history: the old Red Hat Linux inspired Mandrake and more; CentOS Linux was the free RHEL rebuild until 2024) Debian family (.deb, apt) ├── Debian ← the community original, famous for being stable │ ├── Ubuntu ← Debian + a company (Canonical) + a release every 6 months (this course) │ ├── Raspberry Pi OS │ └── Kali Linux ← security testing └── Linux Mint ← built on Ubuntu, friendly desktop Neither └── Alpine ← tiny (about 8 MB), apk packages, BusyBox tools, no bash by default

AlmaLinux: Rocky's twin

When CentOS Linux was discontinued, two free RHEL rebuilds took its place: Rocky Linux (started by one of CentOS's original founders) and AlmaLinux (backed by the company CloudLinux). For everything in this course they're identical: same dnf, same package names, same /etc/sysconfig, same firewalld and SELinux. Wherever a lesson says “Rocky”, it means Alma too.

Amazon Linux 2023: Red Hat family, with surprises

A common mix-up: Amazon Linux is not Debian-based. Amazon Linux 2023 (AL2023) is built from Fedora, so it uses dnf and .rpm, and its /etc/os-release says ID="amzn" and ID_LIKE="fedora". The older Amazon Linux 2 was based on CentOS 7 and reached end of life in June 2026, so migrate anything still running it. Things that surprise Rocky users on AL2023:

Rocky / AlmaAmazon Linux 2023
Log in over SSH asrocky / ec2-user (on AWS)ec2-user
EPEL extra packagesYes: dnf install epel-releaseNot supported. Use Amazon's repos, or install the software another way
Firewallfirewalld, onNone installed. AWS security groups do the job
SELinuxenforcingpermissive (logs, but doesn't block)
croninstalledNot installed. Use systemd timers, or dnf install cronie
Network settingsNetworkManager (nmcli)systemd-networkd
New major versionevery ~3 years (with RHEL)every 2 years, each supported for 5

The AWS learning path (coming soon) will go deeper. The takeaway: dnf commands transfer, but check the “out of the box” assumptions.

Everyone else, side by side

DistroFamilyPackagesAWS loginSecurity moduleContainer image
Rocky LinuxRed HatdnfrockySELinuxrockylinux/rockylinux:9
AlmaLinuxRed Hatdnfec2-userSELinuxalmalinux:9
Amazon Linux 2023Red Hat (via Fedora)dnfec2-userSELinux (permissive)amazonlinux:2023
FedoraRed HatdnffedoraSELinuxfedora
UbuntuDebianaptubuntuAppArmorubuntu:24.04
DebianDebianaptadminAppArmordebian:13
Alpineits ownapk addalpinenonealpine

Alpine is the container favorite because it's tiny, but it has no bash (only BusyBox sh, see lesson 14) and uses a different C library (musl), which occasionally breaks programs built for other distros. It gets a whole lesson of its own next: lesson 16.

Which one am I on?

Every one of them has /etc/os-release (Linux Basics, lesson 1). Scripts should look at ID_LIKE, not just ID. Then a script written for “rhel” also works on Rocky, Alma, Oracle and Amazon Linux without knowing their names:

#!/bin/sh
# which Linux family is this? (give an os-release file, or it reads this machine)
. "${1:-/etc/os-release}"
case "$ID $ID_LIKE" in
  *rhel*|*fedora*|*centos*) echo "$PRETTY_NAME: Red Hat family (dnf, .rpm)" ;;
  *debian*|*ubuntu*)        echo "$PRETTY_NAME: Debian family (apt, .deb)" ;;
  *alpine*)                 echo "$PRETTY_NAME: Alpine (apk)" ;;
  *)                        echo "$PRETTY_NAME: unknown family" ;;
esac

It's written in plain POSIX sh, so it runs even on Alpine.

Try it: the family detector 🧬

Your home folder has os-release/, real /etc/os-release files copied from AlmaLinux, Amazon Linux 2023, Debian and Alpine. Build a tool that sorts them into families.

Quick check

1. Which family is Amazon Linux 2023 in?

2. A Rocky tutorial says sudo dnf install epel-release. It fails on Amazon Linux 2023. Why?

3. Your install script checks if [ "$ID" = "rocky" ]. A colleague runs it on AlmaLinux and it says “unsupported”. The better fix?

Finished the missions and the quiz? Mark it done to track your progress.