MacOS – How to fix permissions for files in the /var/folders/zz

filesystemmacospermission

How can I fix permissions for files in the /var/folders/zz?

There are a lot of file under /var/folders/zz that seem to be application caches or some sort.

I am interested in this because, it appears that if the permissions of these folders get set incorrectly (and there is a lot of "help" out there that suggests changing these at one time or another) it can easily break the applications that use them, like Apple Software Update, Apple Setup Assistant, Adobe Flash Installer, and many others.

Note: This asks a different (although similar) question to the one found in Can I delete files or folders from /private/var/folders/?, and provides a correct & concise answer to this specific question. It is also not about clearing space, but about fixing permissions on these files, which when incorrect WILL break applications.

Best Answer

These application cache directories can be deleted and will be re-created with proper permissions, after a reboot and the various parent applications are re-launched.

There is a lot of confusing half-responses to this question online, but it is safe to delete these folders, and this is a foolproof way to correct permissions. However, it is important that you only delete the underlying folders and do not delete the /var/folders/zz folder itself. There has been at least one bug reported that the OS will not automatically re-create the zz directory (although this may be fixed now).

It is very likely that the system will prevent some of the folders from being deleted. This is usually fine as well.

After deleting the folders, you should reboot immediately.

sudo rm -rf /var/folders/zz/zy*
sudo shutdown -r now

When the system boots and related application start up, the required directories will automatically be re-created with the proper permissions.


Some things that this fix can solve, include:


More Details:

see: http://www.magnusviri.com/OS_X_Admin/what-is-var-folders.html

see: https://osxbytes.wordpress.com/2015/03/19/boot-hang-after-deleting-var-folders/comment-page-1/