Mac OS don't have permission to usr/bin folder

2019-02-21 14:08发布

问题:

I am trying to rename the "codesign" file name for patch problem, but I tired everything and seems like I can only have read access to the filea inside usr/bin

  1. Folder permission "System" is set to Read&Write
  2. I'm on admin account

What I have tried: Going into terminal using sudo -i to get root access to usr/bin for renaming. Typed in renaming command mv codesign codesign_10.11 still get error of Operation can't be performed

What's wrong with my permission access? How can I fix it?

回答1:

Have you upgraded Mac OS X to the "El Capitan" version?

If so, you can't modify anything in /System, /bin, /sbin, or /usr (except /usr/local) anymore, even using the root user. They are calling this "feature" as "System Integrity Protection".

I had the same problem and found this explanation here.



回答2:

execute command line as blow:

sudo gem update --system

sudo gem install -n /usr/local/bin cocoapods



回答3:

Try changing the ownership Code:

chown -R "user_name" folder_name

Eg:

chown -R "John Doe" codesign