Third-party repositories and signing keys
How package signatures are checked, why apt-key is gone and signed-by replaced it, adding a vendor repository safely, pinning priorities, and EPEL and PPAs.
Third-party repositories and signing keys
The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.
Not started
What you'll learn
- A repository is trusted because its index is signed with an OpenPGP key you already hold. Debian's InRelease carries several signatures; RPM repositories sign each package and dnf checks them against the repo's gpgkey.
- apt-key put every key in one global keyring that vouched for every repository, so a vendor's key could sign packages that replace Debian's. It is deprecated, and Debian 13's apt package no longer ships it.
- Put a vendor key in /etc/apt/keyrings/ and name it with Signed-By in that repository's .sources stanza, so the key is valid for that repository only.
- Adding a repository gives its owner root on your machine at the next upgrade. Use apt pinning (apt_preferences) or dnf includepkgs/excludepkgs and priority to limit what it may replace.
- EPEL adds Fedora-maintained extra packages to RHEL-family systems; PPAs are per-person Ubuntu repositories on Launchpad. Both are third parties with their own trust and support level.
Who signed this?
The packages lesson showed a chain of checksums from Debian’s InRelease file down to every .deb. A chain is only as good as its first link, and the first link is a signature. When you add a vendor’s repository, you add a new first link. This lesson is about doing that without handing the vendor more than you meant to.
Think of keys as a building’s access cards. A card that opens one office is reasonable to give a contractor. A master card that opens every door is not, even if you trust the contractor today.
What a signature looks like
I downloaded Debian 13’s InRelease and parsed its signature packets with a short Python script, since this Mac has no GnuPG. It carries three signatures. I matched their issuer fingerprints against the keyrings in the official Debian 13 image’s /usr/share/keyrings/:
4CB5 0190 207B 4758 ... subkey of "Debian Archive Automatic Signing Key (12/bookworm)"
B8E5 F131 76D2 A7A7 ... subkey of "Debian Archive Automatic Signing Key (13/trixie)"
4158 7F7D B8C7 74BC ... "Debian Stable Release Key (13/trixie)"
Two automatic archive keys and a release-team key, so the index stays valid while keys roll over. The image’s debian.sources points each stanza at Signed-By: /usr/share/keyrings/debian-archive-keyring.pgp, which bundles them. That is what apt checks before it believes a single checksum.
The RPM side signs each package instead. Fedora’s fedora.repo sets gpgcheck=1 and gpgkey=file:///usr/share/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch. In the Fedora 45 image, the imported key shows up in the rpm database as a pseudo-package, gpg-pubkey, whose provides include gpg(655a4b02f577861e). The fingerprint I computed from the RPM-GPG-KEY-fedora-45-primary file ends in 655A4B02F577861E, the same key.
Why apt-key died
For years, adding a vendor repository on Debian or Ubuntu meant curl ... | sudo apt-key add -. That put the vendor’s key into the global trusted keyring. The problem is in sources.list(5): if a source names no keyring, “the default is the trusted.gpg keyring and all keyrings in the trusted.gpg.d/ directory”, and “all keys in the trusted keyrings are considered valid signers for this repository”. Every key in that set could sign any repository’s index, including a fake bookworm-security served by a compromised mirror or a DNS attack.
So apt-key was deprecated. Debian 12’s man page says “the use of apt-key is deprecated” and shows replacements. In Debian 13 it is gone: the package file list for trixie’s apt contains apt, apt-get, apt-cache, apt-cdrom, apt-config and apt-mark, and no apt-key. Old install guides that call it will fail.
Adding a vendor repository the right way
The pattern recommended by sources.list(5), written here and not run, for a hypothetical vendor:
sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://packages.example.com/key.asc | sudo tee /etc/apt/keyrings/example.asc >/dev/null
# /etc/apt/sources.list.d/example.sources
Types: deb
URIs: https://packages.example.com/apt
Suites: stable
Components: main
Signed-By: /etc/apt/keyrings/example.asc
The man page names /usr/share/keyrings “for keyrings managed by packages, and /etc/apt/keyrings for keyrings managed by the system operator”, and notes the file must be readable by the _apt user. Signed-By makes apt require that this repository is signed by these keys “rather than all trusted keys apt has configured”. Check the key’s fingerprint against one the vendor publishes on a separate page before trusting it.
On dnf, the equivalent is a .repo file in /etc/yum.repos.d/ with gpgcheck=1 and a gpgkey= URL or file. dnf asks you to confirm the key’s fingerprint the first time and imports it into the rpm database.
Limiting what a repository may replace
A signature proves who built a package, not that you want it. A vendor repository may carry its own builds of common libraries, and the next upgrade will happily install them over the distribution’s if their version is higher.
On apt, pinning controls that. apt_preferences(5) assigns 500 to versions from ordinary sources and 100 to installed versions, and picks the highest priority, then the highest version. A file in /etc/apt/preferences.d/ can lower one repository:
Package: *
Pin: origin packages.example.com
Pin-Priority: 100
The man page’s rule for priorities from 100 to 499 is that a version is installed “unless there is a version available belonging to some other distribution or the installed version is more recent”. So the repository can still supply packages nobody else has, such as the vendor’s own product, but it cannot replace Debian’s openssl. apt-cache policy shows the effect. Pin a single package up to 1000 or more to force a version, even a downgrade, and down below 0 to forbid it entirely.
On dnf, put includepkgs= or excludepkgs= in the repository’s section to restrict which packages it may provide, and priority= to rank repositories. Note the direction: dnf5.conf(5) says the candidate from the repository “with the lowest priority value is picked”, the opposite of apt.
EPEL and PPAs
EPEL, Extra Packages for Enterprise Linux, is a Fedora project that rebuilds additional packages for RHEL and its rebuilds: tools that Red Hat does not ship. Fedora’s getting-started guide says to enable the CodeReady Builder repository first and then install the epel-release package for your major version. It is community maintained, and Red Hat states it does not support EPEL packages or offer SLAs for their fixes.
PPAs, Personal Package Archives, are per-person or per-team repositories hosted on Ubuntu’s Launchpad and added with add-apt-repository ppa:owner/name. They are convenient for newer versions of one tool. Each is a separate party you are trusting with root on every upgrade.
The rule of thumb: every repository you add is a party that can run code as root on your servers. Add few, restrict them, and remove them when you no longer need them.
About the video
The embed is Berardinux’s “APT Adding Repositorys With GPG Key Signing”, November 2022, 11 minutes, in full. It explains why apt-key is deprecated, the new repository layout with keyrings and signed-by, how to find a vendor’s key and repository, and adds the Google Chrome and Opera repositories as worked examples. It uses the one-line sources.list form rather than deb822, it is a desktop-flavoured example, and it is a small channel. Pinning, the RPM side, EPEL and PPAs come from this lesson’s prose and the Red Hat chapters in deeper. I judged it from its chapters and description, and English from its English auto-caption track.
What was run: downloading Debian’s InRelease and parsing its signature packets and the Debian and Fedora keyrings with my own Python on a Mac, and querying the Fedora image’s rpm database with sqlite3. The rest is from sources.list(5) and apt_preferences(5) for trixie, Debian 12’s apt-key(8), Debian’s package file lists, Fedora’s EPEL getting-started guide and Red Hat’s EPEL blog post as reported in search results (both sites blocked automated fetches), checked 2026-11-28. The PPA description is from general knowledge of Launchpad, not a fetched page.
Check yourself
Why is a key in /etc/apt/trusted.gpg.d more dangerous than the same key referenced with Signed-By?
Keys in the global trusted keyrings are accepted for every repository, so that vendor could sign a fake update for any package. Signed-By restricts the key to the one repository whose stanza names it.
You add a vendor's repository and the next apt upgrade replaces Debian's openssl with the vendor's build. How do you stop that?
Pin the vendor repository to a low priority in /etc/apt/preferences.d/ (for example Pin: origin with Pin-Priority below 500) so its versions cannot replace packages that another source also provides, and check with apt-cache policy.
On Fedora, how can you see which repository signing keys rpm currently trusts?
Imported keys appear as gpg-pubkey pseudo-packages in the rpm database, for example via rpm -q gpg-pubkey; each version string is part of the key's ID.
Is EPEL part of RHEL?
No. It is a Fedora project that builds extra packages for RHEL and its rebuilds. Red Hat does not support it, and some EPEL packages need the CodeReady Builder repository enabled.
Go deeper
Notes
Notes are saved to your account.
Everything else on this page works without one — progress and bookmarks keep themselves in this browser and come with you when you sign in. Notes are the one thing worth not trusting to a browser you might clear.
Your notes could not be loaded.