How should the sstate-cache directory be deleted in Yocto?

Viewed 31650

The size of my sstate-cache directory of my YoctoProject "fido" environment is more than 3GB. How can I delete the sstate-cache directory in yocto/build-dir?

Is it save to use rm -rf or is there any other method?

5 Answers

You can delete sstate-cache from build and most common reason for it is, since it keeps growing as more and more cached data is added for every build. There is an easy way of cleaning it, as follows:

./scripts/sstate-cache-management.sh --remove-duplicated -d --cache-dir=<path to sstate-cached>

This removes the duplicated and old data from the cache.

NOTE: When we need to rebuild from scratch, we either remove the build/ tmp so that we can use sstate-cache to speed up the build or we remove both build/tmp and sstate-cache so that no cache is reused during the build.

Related