Is it safe to delete Dart and Flutter package cache?

~/.pub-cache · Safe to delete

What it is

Packages downloaded by dart pub and flutter pub.

Can you delete it?

Yes, it is rebuilt automatically. They are downloaded again on the next pub get.

How to clean it safely

  1. Run: flutter pub cache clean (or dart pub cache clean)
  2. Run flutter pub get in projects you still use.

How big is it on your Mac?

This read-only command prints its size and changes nothing:

 Terminal
du -sh ~/".pub-cache" 2>/dev/null

Step-by-step guide: Developer caches on a Mac →

Questions

Is it safe to delete ~/.pub-cache?

Yes, it is rebuilt automatically. They are downloaded again on the next pub get.

Let the raccoon do it, safely

Junk Raccoon finds this clutter for you, shows every file first, and keeps a one-click way back. Free to download, no account, no ads.

Download for Mac