Moving files to /usr/bin directory

I'm trying to move files to /usr/bin directory with sudo but still I'm getting "Operation not permitted" error. How to resolve this?

MacBook-Air platform-tools % sudo mv * /usr/bin
Password:
mv: fastcopy: open() failed (to): /usr/bin/adb: Operation not permitted


MacBook Air 13″, macOS 12.5

Posted on Oct 26, 2022 12:57 AM

Reply
Question marked as Top-ranking reply

Posted on Oct 26, 2022 5:39 PM

As HWTech wrote /usr/local is ok whereas /usr/bin is off-limits and has been for some time.


About System Integrity Protection on your Mac - Apple Support


I'm not quite sure about homebrew; haven't attempted to install it on silicon Macs yet.

3 replies

Oct 26, 2022 5:27 PM in response to thewickedkarma

Recent versions of macOS restrict access to system areas of the file system.


I'm not certain of the preferred location these days since most searches seem to only result in XCode Command Line Tools, but looking at the Homebrew information it appears "/usr/local" may be the correct folder for Intel Macs while "/opt" is for M1/M2 Macs with Apple Silicon (at least that is what Homebrew is using). From the Homebrew documentation, they give the following reason for using "/opt" on an M1/M2 Mac with Apple Silicon:

https://docs.brew.sh/FAQ
Why is the default installation prefix /opt/homebrew on Apple Silicon?
The prefix /opt/homebrew was chosen to allow installations in /opt/homebrew for Apple Silicon and /usr/local for Rosetta 2 to coexist and use bottles.


For reference to the system area restrictions, check out these two Apple articles:

About the read-only system volume in macOS Catalina or later - Apple Support


Signed system volume security in iOS, iPadOS, and macOS - Apple Support


Hopefully another more knowledgeable contributor will be able to provide a better answer or confirm my information is Ok.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Moving files to /usr/bin directory

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.