Linux

Where Is the Dart Pub Cache?

Dart .pub-cache directory with hosted packages and global activations on Linux.

Last updated

Dart and Flutter download dependencies into .pub-cache in your home directory, with hosted packages versioned beneath it. Global activations like dartdoc live here too, on PATH through its bin folder.

Projects reference the cache through .dart_tool package configs rather than copying. Delete hosted versions freely; pub get restores exact pins from lockfiles.

Where Dart stores this, by platform

Linux
~/.pub-cache

Holds hosted packages per version, global packages with their bin shims, and the credentials file for private publishers. Override with PUB_CACHE for another disk. Copy it to skip redownloading, or wipe it and let pub get rebuild from pubspec.lock.

Frequently asked questions

How do I free pub cache space?

Run dart pub cache clean or flutter pub cache clean to drop unused versions under the folder above. Active projects re-fetch on next get.

Where are globally activated Dart packages?

In the global_packages area of .pub-cache above, with executables shimmed into its bin folder on PATH.

Notice an outdated path? Let us know.