Sub topic 5
Repositories, EPEL, and third-party software
This chapter covers where packages come from on Ubuntu Server, Debian, and Rocky Linux, and what to check when the software you need is not in the default repositories. It assumes you can install packages with apt or dnf, as the previous chapter showed. It also assumes you know what a systemd service is and have a rough idea of how package signing works.
The working model: a repository is a signed catalog
A repository is a server that publishes packages together with an index of what it holds. Your package manager downloads the index, compares it with what is installed, and resolves dependencies against it. Each repository signs its metadata or its packages with a GPG key. The package manager refuses to install from a repository whose key you have not trusted.
Four properties of a repository matter when you choose a distribution:
- Who maintains it. The distribution project, a vendor, or a community group.
- How long it promises updates. Security fixes may be backported for years, or the repository may follow upstream releases.
- How versions change over time. Within one release, versions are usually frozen, apart from fixes.
- How it interacts with other repositories. Two repositories can ship the same package name with different versions, so priority rules matter.
The default repositories are the part you can lean on hardest. Anything you add increases the number of parties you trust with root access to your server, because package install scripts run as root.
Default repositories on each distribution
| Distribution | Default sources | Notes |
|---|---|---|
| Debian | `main`, plus `security` and `updates` suites | `contrib`, `non-free`, and `non-free-firmware` are opt-in components. |
| Ubuntu Server | `main`, `restricted`, `universe`, `multiverse`, plus `-security` and `-updates` pockets | Only `main` and `restricted` are fully supported by Canonical by default. |
| Rocky Linux | `BaseOS`, `AppStream`, and `extras` | Several others, such as `CRB` and `HighAvailability`, exist but are disabled by default. |
Debian splits software by license. main holds software that meets the Debian Free Software Guidelines. contrib holds free software that depends on non-free software. non-free holds everything else, such as some firmware and drivers. Since Debian 12, firmware lives in a separate non-free-firmware component.
Ubuntu splits software by who supports it, not only by license. A package in universe is community maintained. It receives security updates from the community on a best-effort basis unless you attach the machine to Ubuntu Pro, which extends security coverage to universe. This is a common surprise: a package that installs without any warning may sit outside the main support promise.
Rocky Linux splits software by role. BaseOS holds the core operating system. AppStream holds applications, language runtimes, and databases, some of them delivered as modules with several parallel versions. Both are supported for the full life of the release.
Where to look on disk
The configuration files differ between families, and some changed format recently.
# Debian / Ubuntu: legacy one-line format and newer deb822 format
cat /etc/apt/sources.list
ls /etc/apt/sources.list.d/
# Rocky Linux
ls /etc/yum.repos.d/
dnf repolist --allRecent Debian and Ubuntu releases use the deb822 format, stored in files ending in .sources. Older systems use one-line entries in sources.list or .list files. Both are valid on current releases, so you will meet both when you manage a mixed fleet. A deb822 entry looks like this:
Types: deb
URIs: http://deb.debian.org/debian
Suites: bookworm bookworm-updates
Components: main
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpgOn Rocky Linux, each .repo file holds one or more sections with a baseurl or mirrorlist, an enabled flag, and a gpgcheck flag. Check gpgcheck=1 on any repository you add by hand.
EPEL: extra packages for Rocky Linux
Rocky Linux tracks Red Hat Enterprise Linux, which ships a deliberately limited package set. Many popular tools, such as htop, fail2ban, certbot in some configurations, and many Python and monitoring packages, are not in BaseOS or AppStream. EPEL (Extra Packages for Enterprise Linux) fills that gap. It is a Fedora community project that builds additional packages against RHEL-compatible systems.
# Rocky Linux: enable the Extra Packages for Enterprise Linux repository
sudo dnf install epel-release
dnf repolistSeveral facts about EPEL decide how you use it:
- It is community maintained. Rocky Linux does not support EPEL packages, and neither does Red Hat. Updates arrive on the Fedora volunteers' schedule.
- It does not replace base packages. EPEL policy forbids packages that conflict with RHEL content. This keeps the base system stable, but it means EPEL cannot give you a newer version of something that
AppStreamalready ships. - Its lifecycle follows the major release. EPEL 9 serves Rocky Linux 9. A package can be retired when its maintainer leaves, so check how actively a package is maintained before you depend on it.
- Some dependencies live in CRB. Certain EPEL packages need the CodeReady Builder repository, called CRB on Rocky Linux 9 and PowerTools on Rocky Linux 8. Enable it alongside EPEL when a dependency error mentions missing development libraries.
# Rocky Linux 9: enable CRB, then EPEL
sudo dnf config-manager --set-enabled crb
sudo dnf install epel-releaseDebian and Ubuntu have no direct counterpart. Their default repositories are far larger. Debian main carries tens of thousands of source packages, so most of what EPEL provides is already in the default set. This is a real practical difference: on a Debian-family system you reach for a third-party repository less often.
The trade-off: breadth versus freshness
A large archive does not mean new versions. Debian stable and Ubuntu LTS freeze versions at release time and backport security fixes. Rocky Linux does the same, with modules offering a few alternate versions of selected software.
You will notice this when you need a newer runtime than the release shipped. Your options, from most to least conservative, are:
- Use what the release ships. Pick a distribution release whose version matches your needs.
- Use a module stream or a backports pocket. On Rocky Linux,
dnf module listshows alternate versions of software such as PostgreSQL or Node.js. On Debian, thebookworm-backportssuite offers newer builds of selected packages that you opt into per package. - Add the upstream vendor's repository. PostgreSQL, Docker, Nginx, and MariaDB all publish their own
aptanddnfrepositories. - Use a self-contained format. Snap packages (Ubuntu), Flatpak, or containers bundle their own dependencies and update independently of the operating system.
- Build from source. This gives total control and total responsibility for patching.
Each step down the list gives you newer software and shifts more maintenance onto you.
# Debian: install one package from backports
echo "deb http://deb.debian.org/debian bookworm-backports main" | \
sudo tee /etc/apt/sources.list.d/backports.list
sudo apt update
sudo apt install -t bookworm-backports <package>
# Rocky Linux: list and enable a module stream
dnf module list postgresql
sudo dnf module enable postgresql:16
sudo dnf install postgresql-serverReplace <package> with the name of a package that backports actually carries. Stream names change between releases, so read the dnf module list output on your system first.
Adding a third-party repository safely
Adding a vendor repository takes three steps: obtain the signing key, register the repository, and install. The modern Debian-family method scopes a key to one repository with Signed-By. The older apt-key command trusted a key for every repository, and it is deprecated.
# Debian / Ubuntu: scoped key and repository
sudo install -d -m 0755 /etc/apt/keyrings
sudo curl -fsSL https://example.com/repo/key.asc \
-o /etc/apt/keyrings/example.asc
echo "deb [signed-by=/etc/apt/keyrings/example.asc] https://example.com/repo stable main" | \
sudo tee /etc/apt/sources.list.d/example.list
sudo apt updateOn Rocky Linux, a vendor repository is a .repo file with a gpgkey line:
# Rocky Linux: add a vendor repository
sudo tee /etc/yum.repos.d/example.repo >/dev/null <<'EOF'
[example]
name=Example vendor repository
baseurl=https://example.com/rpm/el$releasever/$basearch
enabled=1
gpgcheck=1
gpgkey=https://example.com/repo/key.asc
EOF
sudo dnf makecacheThe URLs here are placeholders. Use the ones in the vendor's own documentation, and verify the key fingerprint against a second source such as the vendor's website over HTTPS.
Ubuntu extras: PPAs and Snap
Ubuntu adds two mechanisms you will not find on Debian or Rocky Linux.
A PPA (Personal Package Archive) is a repository hosted on Launchpad by an individual or team. add-apt-repository ppa:name/archive registers it and imports its key. PPAs are convenient, and quality varies widely. A PPA that replaces a system library can break unrelated software, and a PPA built for one Ubuntu release may not exist for the next. Treat each PPA as a dependency to track through major upgrades.
Snap is Canonical's self-contained package format. Some Ubuntu packages, such as lxd and certain browser builds, are delivered as snaps even when you run apt install. Snaps update automatically and run confined, which helps and surprises in equal measure on a server. You can hold or schedule refreshes with snap refresh --hold, and you can check snap list to see what the system pulled in.
Priorities, pinning, and mixed sources
When two repositories offer the same package, the package manager must choose. The default rule is to prefer the highest version. That rule is dangerous with third-party sources, because a vendor repository can silently replace a distribution package with a newer one.
- On Debian-family systems,
apt policy <package>shows every candidate version and its source. Pin files in/etc/apt/preferences.d/set priorities. A priority above 1000 even allows downgrades, so use values below that unless you intend a downgrade. - On Rocky Linux,
dnf info <package>shows the repository a package comes from. Thepriority=option in a.repofile ranks repositories, and a lower number wins. Settingexclude=orincludepkgs=limits which packages a repository may provide.
# Debian / Ubuntu: see which source wins
apt policy nginx
# Rocky Linux: restrict EPEL to specific packages
sudo dnf config-manager --save --setopt=epel.includepkgs="htop fail2ban*"
dnf repoquery --installed --qf '%{name} %{from_repo}' | grep -i epelThe restriction pattern keeps a broad community repository from replacing anything you did not ask for.
Support boundaries and what they mean in practice
Third-party software changes the support picture, whatever the distribution promises.
- A vendor repository's packages are supported by the vendor, if at all. The distribution project will not debug them.
- An Ubuntu Pro subscription extends security maintenance to
universepackages. Rocky Linux has no equivalent, and EPEL stays community maintained. Commercial support for Rocky Linux comes from third parties such as CIQ. - Debian offers no commercial support from the project. Companies that sell it are separate organizations.
- Security fixes for packages you installed from source or from a binary tarball never arrive through the package manager. You must track their advisories yourself.
A useful habit is to inventory what comes from outside the default set before each major upgrade, because those packages are the ones most likely to block it.
# Debian / Ubuntu: installed packages with no version from an official suite
apt list --installed 2>/dev/null | grep -i '\[installed,local\]'
# Rocky Linux: packages installed from outside the base repositories
dnf list --installed | grep -Ev '@(baseos|appstream|anaconda)'The Debian-family command finds packages with no repository source at all. Packages from third-party repositories need apt policy or apt-cache policy to identify.
A decision pattern for software availability
When a package is missing or too old, work through these questions in order:
- Does the default repository already have it, perhaps under a different name or in a disabled component?
- Does an official backport, module stream, or EPEL package exist?
- Does the upstream vendor publish a signed repository for your distribution and release?
- Can a container or snap isolate the software from the operating system?
- Is the cost of maintaining a source build acceptable?
Common errors
- "Unable to locate package" on Debian or Ubuntu. You skipped
apt update, the component such asuniverseis disabled, or the package name differs in your release. - "No match for argument" on Rocky Linux. The package lives in EPEL or CRB, or a module stream hides it. Check
dnf repolist --allanddnf module list. - "NO_PUBKEY" or "GPG check FAILED". The signing key is missing or does not match. Re-fetch the key from the vendor, and do not bypass the check.
- Dependency conflicts after adding a repository. Two sources offer different versions of a shared library. Inspect with
apt policyordnf repoquery, then pin or exclude. - A vendor repository returns 404 after a release upgrade. The vendor has not built packages for your new release. Disable the repository before upgrading and re-enable it once packages exist.
What this means for choosing a distribution
Debian and Ubuntu Server give you the largest default catalog, so fewer outside sources are needed. Ubuntu adds PPAs, Snap, and optional Pro coverage for universe. Rocky Linux gives you a smaller, tightly controlled base with EPEL as the standard extension, and its strength is the long, predictable lifecycle of that base. If your stack depends on a few vendor-supplied products, check that the vendor publishes repositories and certification for your candidate release before you commit. That check often settles the choice faster than any feature comparison.
Exercise
A Rocky Linux 9 server needs htop, but dnf install htop fails with "No match for argument: htop". Which steps do you take, and which command shows afterward that the package came from EPEL?
Show answer
Install the EPEL repository with sudo dnf install epel-release, and if a dependency error mentions development libraries, enable CRB with sudo dnf config-manager --set-enabled crb. Then run sudo dnf install htop. To confirm the source, run dnf info htop and read the "From repo" field, or run dnf repoquery --installed --qf '%{name} %{from_repo}' htop. Both should name the epel repository. EPEL packages are community maintained, so record that in your inventory.
Exercise
You add a vendor's apt repository to a Debian server, and a later apt upgrade replaces a system library with the vendor's newer build. Which command shows where each candidate version comes from, and what mechanism prevents the replacement?
Show answer
Run apt policy <package> to list the installed version, the candidate version, and the source of each. To prevent the replacement, add a pin file in /etc/apt/preferences.d/ that gives the vendor repository a priority below the distribution's for that package, or limit the vendor repository to the packages you need. Keep priorities below 1000 so apt never downgrades.