rm/mv: Operation not permitted (System Integrity Protection) macOS Origin: Platform & cloud OSI layer 7 · Application Last updated 5 Nov 2026

macOS: rm: /usr/bin/python: Operation not permitted — even with sudo

System Integrity Protection blocks changes to protected system locations, even for root.

Exact message you may see rm: Operation not permittedmv: rename to /usr/bin: Operation not permittedSystem Integrity Protection operation not permitted/usr/bin: Operation not permitted macOS even with sudoln: /usr/bin/x: Operation not permitted
Seen on: macOS

Meaning

SIP protects /System, /usr (except /usr/local), /bin, /sbin and Apple apps. The fix is not to disable SIP but to work in allowed places: install tools under /usr/local, /opt/homebrew or your home folder, and change PATH. For files protected by privacy (Desktop/Documents) the cause is Full Disk Access, not SIP.

Common causes

  • Modifying files under /System, /usr/bin, /bin, /sbin
  • Trying to replace system Python/Ruby
  • Installer writing to a protected path
  • Flag restricted on the file (ls -lO)
  • Confusing SIP with TCC privacy permissions

⚡ Quick fix

  1. Install into /usr/local, /opt/homebrew or ~/
  2. Put your tool earlier in PATH instead of replacing the system one
  3. Check flags: ls -lO /usr/bin/python3 shows restricted

Detailed fix by platform

macOS

  1. csrutil status shows whether SIP is enabled; ls -lO path shows the restricted flag

How to diagnose

  1. Path — Protected by SIP?
  2. Cause — SIP or Full Disk Access?
  3. Alternative — /usr/local?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

Docker Desktop requires privileged access (vmnetd) — macOS: Docker Desktop needs privileged access / com.docker.vmnetd could not be started (macOS)Docker Desktop requir…Homebrew: Permission denied @ dir_s_mkdir — Homebrew: Error: Permission denied @ dir_s_mkdir - /usr/local/Cellar / /opt/homebrew is not writable (macOS)Homebrew: Permission …Item is locked / cannot be deleted (chflags uchg) — macOS: The operation can't be completed because the item is locked / rm: Operation not permitted (uchg flag) (macOS)Item is locked / cann…Operation not permitted (macOS privacy) — macOS: Operation not permitted — Terminal/app lacks Full Disk Access (TCC privacy protection) (macOS)Operation not permitt…Read-only file system (macOS system volume) — macOS: mkdir: /data: Read-only file system / touch: /usr/bin/x: Read-only file system (macOS)Read-only file system…You don't have write permissions for the /Library/Ruby/Gems directory — macOS: ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory (macOS)You don't have write …zsh: command not found: brew — macOS: zsh: command not found: brew (Homebrew not on PATH on Apple Silicon) (macOS)zsh: command not foun…rm/mv: Op…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.