I was installing nodejs for Symphony when I hit an "Operation not permitted" error. Anyone know why this happened?
MacBook-Pro-de-XXX:~ XXX$ sudo ln -s /usr/local/bin/node /usr/bin/node
ln: /usr/bin/node: Operation not permitted
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
This is the so called "rootless" mode in the new version of OS X. It effectively makes certain system directories read-only (even for admins). "/usr" is one of those protected directories (the only subdirectory that is excluded from this rule is "/usr/local")
One can disable this rootless mode with the following commands:
$ sudo nvram boot-args="rootless=0" $ sudo reboot
But this is not recommended! The best practice is to install custom stuff to "/usr/local" only.
Update (27-Oct-15): 10.11 (El Capitan) Public Release
Please note that the above described workaround will not work with the public release of El Capitan anymore as Apple has changed things around.
The proper way to disable the "rootless" mode (aka System Integrity Protection, "SIP") is to boot temporarily into Recover Mode (hold Command+R during boot) and use the
csrutil disable command (or
csrutil enable to reenable) from the Terminal. The Terminal is reachable via the menu of the Installer that launches in Recovery Mode.
In my version of El Capitan the
/bin directory did not exist :
So, the fix was :
mkdir -p /usr/local/bin
-p flag will create the dir (and incidentally any dirs in the full path) if it does not exist.
Then you can create symlinks & copy apps to
/usr/local not part of the "rootless" mode.