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
Password:
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 communityI 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
Password:
ln: /usr/bin/node: Operation not permitted
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.
/usr/texbin
, so away we go!
Jul 29, 2015 at 9:43
In my version of El Capitan the /bin
directory did not exist :
/usr/local/bin
So, the fix was :
mkdir -p /usr/local/bin
The -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/bin
because /usr/local
not part of the "rootless" mode.