Skip to content
Latchkey

opam "No solution found" dependency conflict in CI

opam ran its dependency solver and could not find a set of package versions that satisfies all of your constraints at once. It prints the conflicting requirements and refuses to install.

What this error means

opam install fails with "[ERROR] No solution found, exiting" or "Sorry, no solution found", followed by a list of the constraints that conflict.

opam
[ERROR] Could not determine a set of packages to install:
  - dune >= 3.0 is not available because the package is pinned to 2.9.3
  - your request is rejected

No solution found, exiting

Common causes

Conflicting version constraints

Two dependencies, or a pin and a manifest bound, demand incompatible versions of a shared package, so no install set exists.

A pin or stale repository blocks an upgrade

A leftover pin or an out-of-date opam repository prevents the solver from seeing a version that would satisfy the request.

How to fix it

Update the repository and relax constraints

  1. Run opam update so the solver sees current package versions.
  2. Remove any stray pins that block the needed version.
  3. Re-run the install from the project manifest.
Terminal
opam update
opam install . --deps-only

Inspect the conflict directly

Ask opam to explain which constraints clash so you can loosen the over-tight bound in your opam file.

Terminal
opam install . --deps-only --solver=builtin-mccs --verbose

How to prevent it

  • Run opam update before installing in CI so the solver is current.
  • Avoid leftover pins; remove them once they are no longer needed.
  • Keep version bounds in the opam file as loose as the project allows.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →