5

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.

  • With the edit you've made to the question the answer doesn't actually fit anymore (because it doesn't really explain how to fix permissions). Do you intend to update the answer as well? – nohillside Jan 17 '17 at 19:28
  • Minor edits made to answer based on @patrix comments. – spkane Jan 30 '17 at 18:06
3

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/

  • I error in terminal /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/0: Operation not permitted – bibscy May 8 '18 at 16:20
  • @bibscy you have to either do csrutil disable (enable it again afterwards) or try running this command from recovery mode: command+r while booting, open disk utility to make sure your HD is mounted, close disk utility, open terminal from Utilities menu, and delete /Volumes/[your HD]/var/folders/zz/zy*, and it should work there. – tobek Sep 17 '18 at 3:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .