dbt · Macros, Packages & Advanced

Packages and dbt deps

Easypackagesdbt depsdbt_utils

Interview question

What are dbt packages, and what does dbt deps do?

How to answer

The short answer

Packages are reusable dbt projects you install as dependencies: macros, tests, and sometimes models (e.g. dbt_utils, dbt_expectations, auditor packages).

Declare them

packages.yml:

YAML
packages:
  - package: dbt-labs/dbt_utils
    version: [">=1.1.0", "<2.0.0"]

Install them

Shell
dbt deps

This downloads packages into dbt_packages/ (historically dbt_modules/ in older versions).

Mental model

Good practices

  • Pin version ranges deliberately
  • Commit package-lock.yml when your team uses it for reproducible installs
  • Run dbt deps in CI before dbt build
  • Prefer well-known packages over reinventing and date spines

Interview tip: "dbt deps is to dbt what npm install / pip install -r is to app dependencies."