Sub topic 2
Two lineages: Debian-based and RHEL-compatible
Ubuntu Server, Debian, and Rocky Linux belong to two separate families. Ubuntu and Debian share one lineage. Rocky Linux belongs to the other. Most differences you meet in daily administration come from which family a system is in, not from the distribution's name. This chapter explains how the two families are built, how they relate to each other, and which habits carry over inside a family.
It assumes you are comfortable in a Linux shell and have installed software with a package manager. It also assumes you know what a systemd service is. Later chapters cover release cycles, package commands, and security tooling in detail. Here the goal is to build the map those chapters rely on.
Why the lineage matters
A distribution is a kernel, a set of tools, a package format, a package manager, and a policy about how software is built and updated. Distributions that descend from the same project share most of those choices. A skill learned on Debian works on Ubuntu with few changes. It works on Rocky only in part.
The two lineages differ in these ways:
- The package format (
.debor.rpm) and the low-level tool that handles it. - The high-level package manager that resolves dependencies and talks to repositories.
- Package names and file layout conventions.
- Default security and firewall tooling.
- Who governs the project and how updates are scheduled.
The Debian lineage
Debian is a community project started in 1993. It is governed by its developers under the Debian Social Contract and a written Debian Policy that every package must follow. No company owns it. Its stable releases are conservative: a package version is frozen at release, and only security and critical fixes are added afterward.
Ubuntu is a derivative of Debian. Canonical, a company, builds each Ubuntu release by taking packages from Debian's development branches, changing and adding to them, and publishing the result on a fixed schedule. Ubuntu keeps Debian's .deb format, dpkg, and apt. That is why Ubuntu's ID_LIKE value is debian.
Ubuntu is not just Debian renamed. Ubuntu packages are built separately and often have different versions from the Debian package of the same name. Ubuntu also organizes its archive into components (main, universe, restricted, multiverse) with different support promises, and it ships Snap packages that Debian does not use by default.
The RHEL lineage
Red Hat Enterprise Linux (RHEL) is a commercial distribution from Red Hat. It is built from CentOS Stream, which is built from Fedora. Fedora is the fast-moving community project. CentOS Stream is the rolling preview of the next RHEL minor release. RHEL is the stable, subscription-supported product.
Rocky Linux is a community rebuild of RHEL. It was founded in 2020 after Red Hat announced the end of CentOS Linux, which had been the free rebuild until then. Rocky aims for compatibility with RHEL, meaning software that runs on RHEL of the same major version should run on Rocky without changes. Its governance sits with the Rocky Enterprise Software Foundation, not with a single vendor. AlmaLinux and Oracle Linux are other RHEL-compatible distributions.
Rocky's ID_LIKE value is rhel centos fedora, which lists its ancestors in order.
Compare the direction of the arrows. Ubuntu is a downstream of Debian and adds changes to it. Rocky is a downstream of RHEL and tries not to change it. A derivative that adds its own policy (Ubuntu) behaves differently from one that aims to copy its parent (Rocky).
Side-by-side summary
| Aspect | Debian family (Debian, Ubuntu) | RHEL family (Rocky) |
|---|---|---|
| Package format | `.deb` | `.rpm` |
| Low-level tool | `dpkg` | `rpm` |
| High-level tool | `apt` | `dnf` |
| Admin group | `sudo` | `wheel` |
| Web server package | `apache2` | `httpd` |
| Development headers | `libssl-dev` (suffix `-dev`) | `openssl-devel` (suffix `-devel`) |
| Compiler toolchain | `build-essential` | `dnf groupinstall "Development Tools"` |
| Service defaults file | `/etc/default/` | `/etc/sysconfig/` |
| Mandatory access control | AppArmor | SELinux |
| Governance | Debian: community. Ubuntu: Canonical. | Rocky: community foundation. Upstream: Red Hat. |
Package names are the most common source of confusion when you move between families. The program is the same, but the name differs. apache2 and httpd are the same web server. Always check the package name on the target system before you copy a command from a tutorial.
Querying packages at the low level
Both families have a low-level tool that works on installed packages without touching repositories. The questions are the same, and the commands differ.
| Question | Debian family | RHEL family |
|---|---|---|
| List installed packages | `dpkg -l` | `rpm -qa` |
| List files in a package | `dpkg -L nginx` | `rpm -ql nginx` |
| Which package owns a file | `dpkg -S /usr/sbin/nginx` | `rpm -qf /usr/sbin/nginx` |
| Verify installed files | `dpkg -V nginx` | `rpm -V nginx` |
These work only on packages already installed. To find the owner of a file that is not installed, you need repository metadata, which is covered in the package management chapter.
Detecting the family in a script
The first code example identifies a host. A script that must work on both families should test ID and ID_LIKE together, not the distribution name alone. Debian has no ID_LIKE at all, because it is the root of its family. Ubuntu names Debian in ID_LIKE. Rocky names RHEL.
#!/usr/bin/env bash
# Print the distribution family and the matching package manager.
. /etc/os-release
family="unknown"
for id in "$ID" ${ID_LIKE:-}; do
case "$id" in
debian) family="debian"; break ;;
rhel|fedora|centos) family="rhel"; break ;;
esac
done
case "$family" in
debian) pm="apt" ;;
rhel) pm="dnf" ;;
*) pm="unknown" ;;
esac
echo "$PRETTY_NAME -> family: $family, package manager: $pm"Sourcing /etc/os-release with . works because the file is written as shell variable assignments. The loop checks the distribution's own ID first, then each ancestor. That order matters for Ubuntu, whose own ID (ubuntu) matches nothing, so the loop moves on to debian.
The same script handles distributions you did not plan for. Linux Mint reports ID_LIKE="ubuntu debian", and AlmaLinux reports ID_LIKE="rhel centos fedora". Both land in the right family.
What stays the same inside a family
Within a family you can reuse most knowledge:
- Debian to Ubuntu:
apt,dpkg,/etc/apt/sources.listandsources.list.d, thesudogroup, and most package names are the same. Ubuntu adds Snap, Netplan, andufwas the default firewall front end. - Rocky to other RHEL rebuilds:
dnf,rpm, repository files in/etc/yum.repos.d/,wheel, SELinux, andfirewalldare the same. Binary packages built for RHEL are meant to install unchanged.
What does not carry over
Lineage predicts similarity, not identity. Four limits are worth remembering.
- Packages are not interchangeable between Debian and Ubuntu. A
.debbuilt for Ubuntu may depend on library versions that Debian does not have. Adding Ubuntu repositories or personal package archives (PPAs) to a Debian system can pull in conflicting libraries and break upgrades. Treat repository sources as belonging to one distribution and one release. - Packages are never interchangeable between families. A
.deband an.rpmare different formats. Tools likealiencan convert them, but the result ignores the target's file layout and dependency names, so avoid it on production systems. - Compatibility has a version boundary. A binary built for RHEL 9 is meant to run on Rocky 9. It is not guaranteed to run on Rocky 8 or 10, because the C library, the Python version, and other core components change between major releases.
- Rocky's compatibility depends on Red Hat's source. Rocky rebuilds RHEL, so its timing and its fidelity depend on obtaining RHEL's sources. Red Hat restricted public access to those sources in 2023. Rocky and AlmaLinux responded in different ways, and AlmaLinux now describes itself as binary compatible instead of identical. The practical effect for most servers is small, but a team that needs exact RHEL behavior should weigh it.
Reading a lineage when you inherit a server
You will often receive a server and have to work out its family quickly. A few facts settle it:
- Run
cat /etc/os-releaseand readIDandID_LIKE. - Check which package tool exists:
command -v aptorcommand -v dnf. - Look at the repository configuration:
/etc/apt/sources.list.d/points to the Debian family, and/etc/yum.repos.d/points to the RHEL family.
Then check the release, not only the family. VERSION_ID tells you which support lifecycle applies, which the next chapter covers.
How lineage affects the choice
Lineage affects the choice in three practical ways. The first is skills: a team that knows apt and ufw can run Debian or Ubuntu with little retraining, but it must learn dnf, firewalld, and SELinux to run Rocky well. The second is software: vendors often certify their product for one family or the other, and some publish only .rpm or only .deb packages. The third is governance: Debian and Rocky are community-run, while Ubuntu is steered by one company and Rocky's quality depends on an upstream commercial product.
None of these settles the question alone. Later chapters add release lifecycles, repositories, and support options so you can weigh them together.
Exercise
A script runs on a host and /etc/os-release shows ID=ubuntu and ID_LIKE=debian. A second host shows ID="rocky" and ID_LIKE="rhel centos fedora". Which package manager and which admin group would you expect on each host, and why does a third host with ID=debian and no ID_LIKE line still belong in the Debian family?
Show answer
The Ubuntu host uses apt (with dpkg underneath) and the sudo group. The Rocky host uses dnf (with rpm underneath) and the wheel group. A host with ID=debian has no ID_LIKE because Debian is the root of its family and has no parent to name. Its own ID is the family name, so a script must test ID as well as ID_LIKE.
Exercise
A tutorial tells you to run sudo apt install apache2 and edit /etc/apache2/apache2.conf. You need the same web server on Rocky Linux. What do you change, and what do you check before copying other commands from the tutorial?
Show answer
On Rocky you install httpd with sudo dnf install httpd, and the main configuration file is /etc/httpd/conf/httpd.conf. Before copying other commands, check the package name, the service name, the configuration path, and the service's user account (www-data on Debian and Ubuntu, apache on Rocky). Also check that SELinux and firewalld allow the service, since those are enabled by default on Rocky.