---
name: "dub-add"
section: "1"
platform: "linux"
package: "dub"
version: "1.42.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/dub-add"
---

# dub-add(1)

Adds dependencies to the package file.

## NAME

dub-add - Adds dependencies to the package file.

## SYNOPSIS

**dub add** \<*package*\>\[@\<*version-spec*\>\] \[\<*packages...*\>\] *OPTIONS...*

## DESCRIPTION

Adds \<packages\> as dependencies.

Running "dub add \<package\>" is the same as adding \<package\> to the "dependencies" section in dub.json/dub.sdl.

If no version is specified for one of the packages, dub will query the registry for the latest version.

## OPTIONS

### COMMON OPTIONS

See [**dub**(1)](/dub/1.md)

## EXIT STATUS

- **0**

  DUB succeeded

- **1**

  usage errors, unknown command line flags

- **2**

  package not found, package failed to load, miscellaneous error

## FILES

*dub.sdl*, *dub.json*

## AUTHOR

Copyright (c) 1999-2026 by The D Language Foundation

## ONLINE DOCUMENTATION

http://code.dlang.org/docs/commandline

## SEE ALSO

[**dub**(1)](/dub/1.md), [**dub-convert**(1)](/dub-convert/1.md), [**dub-fetch**(1)](/dub-fetch/1.md), [**dub-init**(1)](/dub-init/1.md)
