Skip to content
Latchkey

opam "Sorry, no solution found" dependency conflict in CI

opam ran its dependency solver over the packages your project needs and could not find a version set that satisfies every constraint at once. It prints the clashing requirements and installs nothing.

What this error means

opam install fails with "[ERROR] Could not determine a set of packages to install" and "Sorry, no solution found, exiting", followed by the constraints that conflict.

opam
[ERROR] Could not determine a set of packages to install:
  - dune >= 3.10 is not available because the package is pinned to 2.9.3
  - your request is rejected
Sorry, no solution found, exiting

Common causes

Conflicting version constraints or a stale pin

A pin or a manifest lower bound demands a version another dependency forbids, so no coherent install set exists in the switch.

An out-of-date opam repository

The repo snapshot in CI predates a release the solver needs, so it never sees the version that would satisfy the request.

How to fix it

Update the repository and drop stale pins

  1. Run opam update so the solver sees current versions.
  2. Remove any leftover pins that block the needed release.
  3. Re-install dependencies from the project manifest.
Terminal
opam update
opam install . --deps-only --yes

Ask the solver to explain the conflict

Run with verbose output to see exactly which two constraints clash, then loosen the over-tight bound in your .opam or dune-project.

Terminal
opam install . --deps-only --verbose

How to prevent it

  • Run opam update before installing in CI so the solver is current.
  • Remove pins 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 →