Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

Repositories · RHEL / Rocky / AlmaLinux

Direct answer

DNF/YUM repositories are defined in .repo files in /etc/yum.repos.d/ with baseurl or metalink, enabled and gpgcheck settings and a gpgkey.

When to use this

Use it when adding a repository, or when dnf fails to download metadata or verify signatures.

First 30 seconds

1. dnf repolist -v — repo URL and status.

2. Download errors → URL/proxy/DNS: curl -I <baseurl>.

3. GPG errors → rpm --import <key> from the vendor.

4. RHEL: subscription-manager repos --list-enabled.

5. dnf makecache after fixing.

Operational verification

repo file → metadata downloaded → signatures checked → packages available

Evidence · next step

For Package Management → RHEL / Rocky / AlmaLinux → Repositories, continue with the first unproven Topic check: Enumerate enabled repository IDs, URLs/metalink/mirrorlist, release/basearch expansion and GPG settings. If that boundary is healthy, advance to the adjacent check: Validate metadata refresh plus certificate/network/entitlement/signature errors independently. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Scope / prerequisiteUse it when adding a repository, or when dnf fails to download metadata or verify signatures.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

repo definition + variables/entitlement → DNS/TLS/HTTP access → repomd metadata → GPG trust → package/module metadata → solver origin/priority → NEVRA candidate → RPM transaction

Healthy evidence: enabled repo definitions are intentional, metadata is fresh and trusted, entitlement/access is valid where required and selected package origin matches policy.

Step 2 Verification and output interpretation Verify boundary

Existing fast checks for this Topic. - Enumerate enabled repository IDs, URLs/metalink/mirrorlist, release/basearch expansion and GPG settings.

  • Validate metadata refresh plus certificate/network/entitlement/signature errors independently.
  • Inspect exact package NEVRA and repository origin, including modules/excludes/versionlocks where relevant.
  • After repo changes, rebuild/refresh metadata deliberately and re-evaluate the candidate transaction before installing.

Verification chain. repo definition + variables/entitlement → DNS/TLS/HTTP access → repomd metadata → GPG trust → package/module metadata → solver origin/priority → NEVRA candidate → RPM transaction

Step 3 Commands Verify boundary
dnf repolist
cat /etc/yum.repos.d/*.repo
dnf config-manager --set-enabled crb
Step 4 Failure modes and next checks Narrow the fault

Suspicious evidence: stale cache, wrong releasever, disabled base repo, entitlement issue or third-party repo changes package visibility/provenance unexpectedly.

Step 5 Common mistakes Narrow the fault
  • Enabling third-party repos without GPG checks.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points

Keep gpgcheck=1 and import the vendor key. Disable a repo per command with --disablerepo. On RHEL, many repos are managed by subscription-manager — enable them there.

Key checks
  • apt policy <pkg> / dnf info <pkg> — installed and candidate versions
  • dpkg -l <pkg> / rpm -q <pkg> — installed package
  • apt-cache depends <pkg> / dnf repoquery --requires <pkg> — dependencies
  • dpkg -S <file> / rpm -qf <file> — package owning a file
ReferenceWhat it is1 section · depth on demand

Core model

Inventory every enabled repo and expansion of releasever/basearch variables. Validate reachability separately from repository metadata and GPG trust. For vendor-managed RHEL, subscription/entitlement can be part of access; Rocky/Alma and third-party repos differ. Correlate repo priority/exclusions and module metadata with the exact selected NEVRA rather than assuming an enabled repo supplied it.

ReferenceImportant terms & boundaries5 sections · depth on demand

What this shows and what it does not

Repository evidence shows configured source, access and metadata/trust conditions, not which candidate ultimately wins or whether installed software works.

In depth

DNF repositories: .repo files and options

Repositories for DNF are defined in .repo files in /etc/yum.repos.d/. Each section is named by a repository ID in brackets. The DNF configuration reference documents the main options:

OptionDefaultMeaning
nameThe repo IDHuman-readable name
baseurlNoneRepository URLs, tried in order
metalink / mirrorlistNoneURLs listing mirrors
enabledTrueWhether the repository is used
gpgcheckFalseVerify package signatures
gpgkey—URLs of the keys to verify with
priority99Lower values are preferred
skip_if_unavailableFalseContinue (and disable the repo) if it can't be reached

The default for gpgcheck in the reference is False, but distribution and vendor repo files set gpgcheck=1 explicitly. Always keep it enabled for your own repository files too.

A vendor repository file

host$ cat /etc/yum.repos.d/example.repo
[example]
name=Example Agent for EL9
baseurl=https://repo.example.com/el/9/$basearch/
enabled=1
gpgcheck=1
gpgkey=https://repo.example.com/RPM-GPG-KEY-example
repo_gpgcheck=0
priority=50
host$ sudo dnf makecache --repo example
host$ dnf repolist -v example | grep -E "Repo-id|Repo-baseurl|Repo-pkgs"
host$ rpm -q gpg-pubkey --qf '%{NAME}-%{VERSION}-%{RELEASE}\t%{SUMMARY}\n'
host$ sudo dnf config-manager --set-disabled example
host$ sudo dnf --disablerepo='*' --enablerepo=baseos list available 'kernel*' | head -3

Variables in repository URLs

VariableExpands to
$basearchx86_64, aarch64
$releaseverThe OS release, e.g. 9
$archThe exact architecture

Local mirrors

NeedApproach
Patch servers without Internet accessSync repositories with dnf reposync, publish them over HTTP
Consistent updates across environmentsSnapshots per date (Pulp, Satellite, Foreman)
Own packagescreaterepo_c on a directory of RPMs

Priorities

When several repositories offer the same package, a lower priority value wins. That keeps a third-party repository from replacing distribution packages unexpectedly. dnf info pkg shows which repository a candidate comes from.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

How it works at runtime

Repositories is part of Package Management → RHEL / Rocky / AlmaLinux → Repositories. RHEL-family repositories expose signed RPM metadata and packages through configured repository definitions; baseurl/mirrorlist/metalink, GPG policy, release variables, entitlements and modular metadata can all affect package visibility and selection.

Topic-specific state model. RHEL-family repositories expose signed RPM metadata and packages through configured repository definitions; baseurl/mirrorlist/metalink, GPG policy, release variables, entitlements and modular metadata can all affect package visibility and selection.

Interpretation rule. - Repo reachable ≠ repomd metadata trusted.

  • GPG check enabled ≠ package came from intended repository.
  • Repository enabled ≠ package selected from it.
  • Entitlement/access success ≠ dependency solution or workload health.

Quick reference

RHEL-family repository definition:

# /etc/yum.repos.d/internal.repo
[internal-baseos]
name=Internal BaseOS mirror
baseurl=https://repo.example.com/rhel9/baseos/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
sslverify=1
metadata_expire=6h

dnf config-manager --set-enabled crb
dnf repolist -v
reposync --repoid=baseos -p /srv/mirror --download-metadata    # build a local mirror

Internal mirrors (Pulp, Satellite, Foreman/Katello, reposync) give controlled, tested package sets per environment.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Limits and how it fails

Primary failure point. Repository evidence shows configured source, access and metadata/trust conditions, not which candidate ultimately wins or whether installed software works.

ReferenceConfiguration & state1 section · depth on demand

Configuration, persistence and lifecycle

Distribution/platform context. RHEL-family Repositories owns repository definitions, metadata access/trust and entitlement/source boundaries. DNF/YUM own selection/solving; network/TLS owns lower transport failures.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

Authoritative/upstream documentation reviewed for bounded claims in Package Management → RHEL / Rocky / AlmaLinux → Repositories. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.debian.org/doc/manuals/debian-reference/ch02.en.html · confidence 94%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
dnf repositoriesyum repositoriesrhel repo filesrpm repository gpg
Embedded reference data

Quick lookup tables

Repositories operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for Repositories.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateRHEL-family repositories expose signed RPM metadata and packages through configured repository definitions; baseurl/mirrorlist/metalink, GPG policy, release variables, entitlements and modular metadata can all affect package visibility and selection.Establish exactly what this Topic owns before crossing into another subsystem.
Fast verificationPin host + distribution/release + architecture → identify exact package/version request → enumerate effective repositories/trust → refresh/inspect metadata → compare installed versus candidate/origin → review dependency/conflict transaction → capture package-manager transaction → verify local package database/files/scripts → inspect service/reboot/config effects → repeat original workload test.Use the shortest evidence path first; a fast check is a boundary test, not blanket proof.
Verification chainrepo definition + variables/entitlement → DNS/TLS/HTTP access → repomd metadata → GPG trust → package/module metadata → solver origin/priority → NEVRA candidate → RPM transactionTrace requested/configured state through effective state to the observed workload result.
Failure boundaryRepository evidence proves configured source, access and metadata/trust conditions, not which candidate ultimately wins or whether installed software works.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux package-management evidence can establish this proof path: repo definition + variables/entitlement → DNS/TLS/HTTP access → repomd metadata → GPG trust → package/module metadata → solver origin/priority → NEVRA candidate → RPM transactionUse this observation only for the specific claim it actually supports.
Evidence limitIt does not independently prove behavior outside the captured repository, solver, transaction, local package database, runtime-side-effect or workload scope. Repository evidence proves configured source, access and metadata/trust conditions, not which candidate ultimately wins or whether installed software works.Do not promote a local success signal into end-to-end or adjacent-dependency proof.
Next troubleshooting checkContinue from the first unproven boundary: confirm distribution/release and repository trust, inspect candidate/origin and solver policy, correlate the package-manager transaction with dpkg/RPM local state, then test affected services and the original workload before making additional package changes.Continue to the next unresolved boundary while preserving the original test condition.

Repositories · operational reference

Compact Linux state, persistence, verification and boundary reference for fast lookup.

Reference boundaryRepositories
Topic pathPackage Management → RHEL / Rocky / AlmaLinux → Repositories
Runtime stateRHEL-family repositories expose signed RPM metadata and packages through configured repository definitions; baseurl/mirrorlist/metalink, GPG policy, release variables, entitlements and modular metadata can all affect package visibility and selection.
Fast checks- Enumerate enabled repository IDs, URLs/metalink/mirrorlist, release/basearch expansion and GPG settings. - Validate metadata refresh plus certificate/network/entitlement/signature errors independently. - Inspect exact package NEVRA and repository origin, including modules/excludes/versionlocks where relevant. - After repo changes, rebuild/refresh metadata deliberately and re-evaluate the candidate transaction before installing.
Verification chainrepo definition + variables/entitlement → DNS/TLS/HTTP access → repomd metadata → GPG trust → package/module metadata → solver origin/priority → NEVRA candidate → RPM transaction Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary.
Failure boundaryRepository evidence proves configured source, access and metadata/trust conditions, not which candidate ultimately wins or whether installed software works. Boundary chain: repository/metadata → dependency resolution → artifact/signature → package database/file install → scriptlets → service/process reload → effective binary/config → workload.
Persistence ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?