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?
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?
It is safe to delete the sstate-cache directory, however the proper way to reduce its size is by using the script in poky/scripts/sstate-cache-management.sh which will remove older entries. See https://git.yoctoproject.org/cgit.cgi/poky/plain/scripts/sstate-cache-management.sh
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.