I've accidentaly removed my /usr/local on 10.11b2.
Is there any way to re-create it?
I thought about "Fix Permissions" in Disk Utility, but there is only "First Aid" now and it does not help.
I've accidentaly removed my /usr/local on 10.11b2.
Is there any way to re-create it?
I thought about "Fix Permissions" in Disk Utility, but there is only "First Aid" now and it does not help.
I'm not sure that /usr/local even exists in a fresh install. It's not necessary and doesn't contain anything. If something needs to install stuff into it, it should be able to create it.
The command "pkgutil --file-info /usr/local" doesn't show any packages whose receipts/bills-of-materials are associated with it (by contrast with "/usr/bin", for example).
As near as I can tell on my brand-new Yosemite system, the directory has the exact same properties as one created by "sudo mkdir".
Ken,
El Capitan uses new "restricted" flag for system directories, so /usr is not writable even by root.
http://pointlessramblings.com/posts/El_Capitan/
http://arstechnica.com/civis/viewtopic.php?f=19&t=1285405
You'd have to disable SIP first and then extract the folder from the installer. Using the Pacifist app would probably be the easiest way.
So how were you able to delete the directory, if SIP disallows modifications to /usr? If you were in a position to delete it (e.g. SIP is disabled), you're in a position to recreate it using the sudo mkdir command as I suggested.
Good point. My guess is that you can still delete 10.11 protected folders while booted into an earlier OS X because the earlier system doesn't recognise the "can't touch this" flag.