Cannot remove a file as root

Hi,


I'm trying to do some annual cleanup on my MacBook Pro. There is an old executable (python3) from an upgrade a few years back. The file is in /usr/bin. When I try to remove the file I get an error.


Operation not permitted. Even when I use sudo. Same error if I use sudo -I and become root I cannot remove the file.


I opened up a case with Apple support. The tech handling the call does not know shell programming, so I had him escalate. Supposedly the Apple engineering department says they can't do anything because they do not support Python! This is absolutely ridiculous. Removing a file from the shell using bash, sh, or zsh has nothing to do with Python. This is basic BSD Unix 101 here folks! I have been using a MacBook Pro for 15 years. Creating and removing a files from the shell is normal operation.



Does anyone have any insight as to what is going on here? Has Apple support just gone down a hole? I was told I have to write down my complaint and then it will be pushed up.


Any comments would be appreciated.


Ed


Posted on Feb 4, 2021 2:50 PM

Reply
Question marked as Top-ranking reply

Posted on Feb 5, 2021 9:08 AM

I am guessing here: but if you are running Big Sur, you no longer have any access to the OS or its system files as they are sequestered in a read only volume which is not accessible to you or anyone/anything else.


https://support.apple.com/en-us/HT210650

Similar questions

11 replies

Feb 5, 2021 10:35 AM in response to edkenny

Consider the read-only filesystem in Catalina and Big Sur as the ultimate roach motel. Past files that were written in the system can never check out (e.g. be removed by the user).


Neither Python.org nor homebrew install Python 3 in the /usr/bin location but starting with Xcode 11 or command-line tools for Xcode 11, it installed an outdated Python 3.8.2 into /usr/bin/python3.

Feb 5, 2021 11:26 AM in response to edkenny

The command-line tools for Xcode 11 and later (including 12.4) install that /usr/bin/Python3 item and a minimal Python3 distribution with it. I avoid it like the plague.


Instead, I use the Python.org installer for every installation, which writes the following directory


/Library/Frameworks/Python.framework/Versions/3.9


and then links binaries from that location back into /usr/local/bin as python3, idle3, pip3, etc., and an /Applications/Python 3.9 folder.

Feb 5, 2021 9:39 AM in response to babowa

Thanks for the input. If this is true, I can see what probably happened. The file was there a long time ago. when I upgraded and now is a permanent part of the file system. Wonder why it was never put in relocated files?



Maybe there is a way to turn off protection and temporarily mount the file system as RW?


Again I have to ask why Apple support never mentioned this!

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.

Cannot remove a file as root

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