macOS: The operation can't be completed because the item is locked / rm: Operation not permitted (uchg flag)
A file has the immutable (uchg) flag or is in use, so Finder/rm refuse to delete or change it.
The operation can't be completed because the item is lockedThe item is locked and can't be deletedrm: Operation not permitted uchgThe operation can’t be completed because the item “x” is in userm: cannot remove: Operation not permitted macOS locked file Meaning
Clear the flag: chflags nouchg file (recursive: chflags -R nouchg dir), or untick "Locked" in Get Info. If it still fails, check ACLs (ls -le), extended attributes (xattr), whether an app has it open (lsof), and Full Disk Access for Terminal.
Common causes
- Immutable
uchgflag set (locked file) - File in use by an app
- ACL denying delete
- Protected system area (SIP)
- Terminal lacks Full Disk Access
⚡ Quick fix
chflags -R nouchg paththen deletelsof pathto find usersls -lO@e pathto inspect flags/ACLs/xattrs
Detailed fix by platform
macOS
ls -lO pathshowsuchg;sudo chflags -R nouchg path
How to diagnose
- Flags — uchg set?
- Usage — lsof output?
- ACL — Present?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Docker Desktop requires privileged access (vmnetd) macOS: Docker Desktop needs privileged access / com.docker.vmnetd could not be started
- Finder error code -36 macOS: The Finder can't complete the operation because some data in "x" can't be read or written. (Error code -36)
- Finder error code -43 macOS: The operation can't be completed because one or more required items can't be found. (Error code -43)
Most viewed in macOS
- is damaged and can’t be opened macOS: “App” is damaged and can’t be opened. You should move it to the Trash.
- zsh: command not found: brew macOS: zsh: command not found: brew (Homebrew not on PATH on Apple Silicon)
- git: 'credential-osxkeychain' is not a git command Git: git: 'credential-osxkeychain' is not a git command. See 'git --help'
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 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.
Report a correction or suggest an improvement
Last updated 5 Nov 2026