macOS Needs To Repair Your Library

Today I had a client that had restored a Mojave iMac Pro from a non-Time Machine backup and they were encountering the following error:

macOS needs to repair your libraryā€¯ error loop on Mojave upgrade - Ask  Different

Every once in awhile when users encounter this error message, they enter their password and are presented with the same error time after time in a loop.

Thankfully, stack exchange user Cheefachi presented a clean and easy to implement solution: run a resetUserPermissions command via Terminal.

With the error prompt still on screen, open Terminal (you can use Spotlight to quickly pull it up) and enter the following command as the current logged in user.

diskutil resetUserPermissions / `id -u`

When running that command, you may see a prompt to enter your admin user and password to allow Disk Utility to repair the user’s permissions. Go ahead and do so.

Once Disk Utility finishes its task, you should see documents and materials repopulate on the desktop.

If the library repair prompt is still visible, you can either click cancel until the messages go away or reboot your machine.

Once the desktop is populated, I do recommend rebooting to make sure the fix holds.

This solution has been tested on both High Sierra and Mojave. I haven’t come across the error in Catalina or Big Sur.