---
name: "dub-clean"
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-clean"
---

# dub-clean(1)

Removes intermediate build files and cached build results

## NAME

dub-clean - Removes intermediate build files and cached build results

## SYNOPSIS

**dub clean** \[\<*package*\>\] *OPTIONS...*

## DESCRIPTION

This command removes any cached build files of the given package(s). The final target file, as well as any copyFiles are currently not removed.

Without arguments, the package in the current working directory will be cleaned.

## OPTIONS

- **--all-packages**

  Cleans up \*all\* known packages (dub list)

### 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-clean-caches**(1)](/dub-clean-caches/1.md), [**dub-remove**(1)](/dub-remove/1.md)
