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

yoctotutor.com picture yoctotutor.com · Jul 27, 2017 · Viewed 18.9k times · Source

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?

Answer

g0hl1n picture g0hl1n · Jul 27, 2017

According to the Yocto Reference Manual it is save to remove the complete build/tmp directory including the sstate-cache directory:

As a last resort, to clean up a build and start it from scratch (other than the downloads), you can remove everything in the tmp directory or get rid of the directory completely. If you do, you should also completely remove the build/sstate-cache directory. (see [1] and [2])

Furthermore you can remove the sstate-cache with bitbake for a specific recipe by calling do_cleansstate like shown below (see do_cleansstate).

$ bitbake -c cleansstate recipe

Please be aware that the Shared State Cache needs a lot of memory space and it will be growing again to the size it needs during building your images.

More detailed information on the Shared State Cache is available in following sections of the Yocto Reference Manual: Shared State Cache and sstate-cache.