MacOS – How to load the DiskManagement framework in single user mode

disk-utilitymacossingle-user

From single-user mode in OS X 10.5, I want to run

diskutil repairPermissions /

but I get an error:

Unable to run because unable to use the DiskManagement framework
...

Is there a way to load the DiskManagement framework or otherwise repair permissions in single user mode?

Best Answer

The Disk Utility Repair Permissions command is just a front end for the repair_packages program.

Use this:

 /usr/libexec/repair_packages --repair --standard-pkgs

Suggestion: run /sbin/mount -uw / prior to running the above command. Sometimes the disc may be mounted as read only and the command above will not work until you mount it with write permissions. You will be then able to successfully restore file permissions using the command after mounting the disk as writeable. The command ran for over two hours.