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").
No match for argument: libpq-devel
Error: Unable to find a match: libpq-develCommon 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.
RUN dnf install -y epel-release \
&& dnf config-manager --set-enabled crb \
&& dnf install -y libpq-develConfirm the RHEL/Fedora package name
- Search for the real package name on the base distribution.
- Use the
-develname where headers are needed. - Re-run the build after correcting the name.
dnf search libpqHow 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
-develpackage for build headers.