4

The command flutter pub cache repair downloads every package version previously used, even of libraries that I no longer use. Why?

Is there any way to clean everything and download only the last packages version?

Davide Bicego
  • 562
  • 2
  • 6
  • 24

1 Answers1

11

Unfortunately, Dart development team believes that disk space problems are a thing of the past, and does not provide a standard command to clear the global cache.

Therefore, there is only one way - it is to clear the folder ~/.pub-cache/hosted/pub.dartlang.org yourself. You can then reinstall packages for each actual application separately.

Spatz
  • 18,640
  • 7
  • 62
  • 66
  • Could you clarify what you mean with "You can then reinstall packages for each actual application separately."? – jurrdb Jun 12 '23 at 08:55