mac os needs to repair your library to run applications

A few weeks back, I was using my computer over the weekend. When I was done I did what I always do, I locked the screen and went to bed. When I came back and authenticated I was presented with the following pop-up

mac os needs to repair your library to run applications

What would ensure is another example of trial and error due to missing log messages. Read on to learn more!

As I mentioned, one morning I was presented with a message on my laptop. After authenticating like it had asked the message popped up again. I did this dozens of times before I realized that it was not going to go away. Given it took priority on my screen and I had no way of navigating anywhere else, I finally decided to hard reboot. When I logged back in, I was presented with what appeared to be a fresh install of mac os — the desktop was not the customized one I had created. In addition, the pop up message greeted me again — this was going to be fun.
Now I know what you must be thinking — it was something I installed or some change I made to the system. The thing was, I had not installed anything and I had not made any changes. The night before I was working on my homelab which required only a terminal window with SSH and a browser. While I would have loved to go check the logs, the pop up prevented me from doing anything on the same. Down the troubleshooting path I went:

  • SMC reset — nope
  • Single user mode — nope
  • Recovery Mode with Disk Utility First Aid — nope

All the normal steps failed me so I decided to go back into Recovery Mode and see what Terminal had to say. I was able to properly navigate my home directory, but to my surprise 95% of my files and directories were owned by root and 5% were owned by “501”, which is my User ID number.

Note: I did check /etc/passwd to double-check it was my User ID number, but did not find the entry — then I realized mac os uses OpenDirectory instead.

Suspecting a permission issue, I was hoping to run the disk repair permissions option in Disk Utility, however I am running mac os Sierra and that feature has been removed. My only alternative was to reinstall mac os — so I did. Unfortunately, this did not fix the issue either — likely because the reinstall intentionally does not mess with existing home directories.
Running out of options, I decided to fix my home directory permissions from the Terminal application in Recovery Mode:

# chown -R <username> /Users/<username>

When I rebooted, I was happy to see that my profile was returned and the pop up was gone. I did not have a root cause, but at least my problems were solved — or so I thought. Everything appeared to be working properly, except my Outlook application. In my next post, I will cover the problems I had with Outlook as well as the solution.

© 2017, Steve Flanders. All rights reserved.

10 comments on “mac os needs to repair your library to run applications

Carl says:

Hello and thank you for the post.
I too had this happen suddenly yesterday evening. I had just moved my account form a one machine to another a few days ago, and all went well. A copy of VNWare Fusion was in the backup that was moved over. My (new) machine had been up and running flawlessly for at least 8 hours yesterday when I started up VMWare Fusion for the first time on this new machine. That is when the messages started popping up (macOS needs to repair your library). I thought that my installed copy of Fusion may have been messed up in the process of the transfer and caused the problem. I had to get ahead of the pop up messages before I could reinstall Fusion.
I pulled down another copy of macOS 10.12.4 and reinstalled that over my existing installation, hoping this would conquer the pop up messages, but they still kept coming. The new OS install did not help. I found another machine with which I could go on line, and then I found this post of yours.
My problem though was when I booted into Recovery Mode, the /Users/ folder was absent. I reboot from a USB flash drive. The /Users folder was now visible. I did the chown -R 502 Users/ from there. Things appear to be working fine now. All my apps and Mail is still in place.
Thanks for your posting.

Hey Carl — Thanks for the comment and the information! I am glad you found a solution for your issue as well.

cesar says:

Question Steve, In that little script it has the current user, that is logged in? can you give an example please.

Hey Cesar — Use the username for your account. If you do not remember, the “cd /Users; ls” to list all user accounts. I hope this helps.

Chad says:

Great post! This issue has happened on two different Sierra machines for me now, and that terminal command will come in very handy.

Hey Chad — Thanks for the comment, weird that multiple people have seen this behavior.

Frac says:

My only question is what kind of impact will this have on other users? As if the Mac is used by several different people daily.

Hey Frac — every user has their own home directory so as long as the used in after the -R flag is the same as the username in the /Users directory, this will have no impact on other users. Of course, if you do mess up you can run the command again with the correct username.

I just experienced the exact same thing. I ran VMWare Fusion on Mac OS X Sierra (for the first time in a very long time) … It took an long time and didn’t seem to be doing anything .Then I had a couple of applications like “Google backup and sync” crash, and my system started generating errors. So I rebooted and was faced with precisely the same issues you describe. I don’t have permissions to access my own desktop or documents and everything appears rest to details ,so I’ll try the chown solution you recommend.

So weird — I hope it worked for you!

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top