question
On Mac 10.11 (El Capitan), an Operation not permitted error occurs when operating on a system-protected folder.
And it can't be solved by sudo
reason
This is the newly introduced defense mechanism System Integrity Protection of mac
You can view it with the following command
csrutil status
solution
If you must operate in the system folder, you can turn off this mode:
1. Restart, press and hold Command+R on the boot loading interface to enter recovery mode,
2. Open Terminal and enter the command
csrutil disable
3. Restart again to operate with sudo
If you need to re-enable the defense mechanism, you can use the same method to enter the recovery mode command line, enter
csrutil enable
see
Unix “ln -s” command not permitted in OSX El Capitan Beta3
"Operation not permitted" in /usr/bin in Mac OS X 11
Operation Not Permitted when on root El capitan (rootless disabled) [closed]