## TL;DR

Two packages (often dbt-utils and another) require incompatible versions of something, or dbt-utils requires a different dbt-core than you have. Pin every package to mutually compatible revisions, delete `package-lock.yml`, and run `dbt deps` fresh.

## Error

```text
dbt packages.yml failed with dbt-utils version conflict error
```

## Steps

1. Open `packages.yml` and list each package's version or revision. Expected: you see the full requested set.
2. Check dbt-utils' release notes for the dbt-core versions it supports, and do the same for your other packages. Expected: you identify the incompatible pair.
3. Pin compatible versions explicitly, for example:
```yaml
packages:
  - package: dbt-labs/dbt_utils
    version: [">=1.0.0", "<2.0.0"]
```
Expected: every package has a pin compatible with your dbt-core.
4. Delete `package-lock.yml` (it may be pinning the conflict) and any stale `dbt_packages/` directory. Expected: no cached resolution remains.
5. Run `dbt deps`. Expected: all packages install without conflicts.

## When to use

- `dbt deps` fails with a version conflict mentioning dbt-utils or another package.
- You just upgraded dbt-core and deps broke.

## When not to use

- `dbt deps` fails on git authentication (fix credentials, not versions).
- A package installs but its macros misbehave (a compatibility bug, not a resolution conflict).

## Tool compatibility

- dbt Core 1.0 and later, dbt Hub and git packages.

## Variant phrasings

### dbt deps: could not resolve package versions

The resolver failed; pinning narrows the search space enough to succeed.

### Package requires dbt-core >= X but you have Y

Upgrade dbt-core or downgrade the package; one side has to move.

## Why it happens

dbt resolves package versions against your installed dbt-core and against each other. Unpinned packages float to latest, which eventually requires a newer core than you run, or two packages demand incompatible ranges.

## Edge cases

- Git packages pinned to branches move over time; pin to tags or SHAs for reproducibility.
- `dbt deps --upgrade` re-resolves everything; use it deliberately, not casually.
- Private registry mirrors can serve stale versions; check the mirror when pins look right but fail.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_xMFP_iEd-WtU8EnfFyEMqw
