Skip to content
Latchkey

Dockerfile dnf "Unable to find a match" in CI

dnf could not find the requested package on a RHEL or Fedora base image. The name may be wrong, or the repository that provides it (EPEL, CRB) is not enabled.

What this error means

A RUN dnf install step prints "No match for argument: X" and "Error: Unable to find a match: X" (older yum prints "No package X available." then "Error: Nothing to do").

docker build
No match for argument: libpq-devel
Error: Unable to find a match: libpq-devel

Common causes

Wrong package name for the distribution

The name differs on RHEL/Fedora (often a -devel suffix) or is simply misspelled, so dnf finds no match.

A required repository is not enabled

The package lives in EPEL or CodeReady Builder (CRB), which the base image does not enable by default.

How to fix it

Enable the repository that provides it

Add EPEL or enable CRB before installing the package.

Dockerfile
RUN dnf install -y epel-release \
 && dnf config-manager --set-enabled crb \
 && dnf install -y libpq-devel

Confirm the RHEL/Fedora package name

  1. Search for the real package name on the base distribution.
  2. Use the -devel name where headers are needed.
  3. Re-run the build after correcting the name.
Terminal
dnf search libpq

How to prevent it

  • Verify package names against the RHEL/Fedora base, not Debian.
  • Enable EPEL or CRB when a package needs them.
  • Use the correct -devel package for build headers.

Frequently asked questions

What causes ""Error: Unable to find a match""?
The name differs on RHEL/Fedora (often a -devel suffix) or is simply misspelled, so dnf finds no match.
How do I fix "Error: Unable to find a match"?
Add EPEL or enable CRB before installing the package.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card