If you can't restore /usr/
from a backup, you could first start up in single user mode (by holding command-S on startup) and run chown -R root /usr/
.
On my installation, all files under /usr/local/
were owned by either root or me, a few files under /usr/
were owned by _uucp
, and all other files under /usr/
were owned by root:
$ sudo find /usr/local ! -user root ! -user $USER
$ sudo find /usr/!(local) ! -user root -print0|xargs -0 stat -f '%Su %N'
_uucp /usr/bin/cu
_uucp /usr/bin/uucp
_uucp /usr/bin/uuname
_uucp /usr/bin/uustat
_uucp /usr/bin/uux
_uucp /usr/sbin/uucico
_uucp /usr/sbin/uuxqt
_uucp /usr/share/uucp
This would change the owner of the uucp
files:
sudo chown _uucp /usr/bin/{cu,uucp,uuname,uustat,uux} /usr/sbin/{uucico,uuxqt} /usr/share/uucp
/usr/local/
does not exist on a fresh installation of OS X. If you only used /usr/local/
with Homebrew, you might delete /usr/local/
and then reinstall Homebrew.
Alternatively, you could use Pacifist to copy the default /usr/
from an OS X installer downloaded from App Store. Doing an upgrade install of OS X from the recovery partition or upgrading to 10.9 might also restore the owners of some files.