I installed a program on my Mac that I now want to remove. But when I try to drag it to the trash I get a “item is locked” error. What the heck? How can I remove it?
Like all modern operating systems, your Mac has a sophisticated model for managing files and applications. One of the most important features is what’s getting in your way; making sure that the wrong files aren’t accidentally – or deliberately – removed or changed. You can imagine a hacker sneaking onto your computer, changing some of the key system files (like the change password utility!) and causing quite a problem with your system.
Administrative programs and utilities can not only be locked down with permissions, though, they can also be “hidden” and not show up in the Finder without extra work. Even in Terminal, it can require expert knowledge to show absolutely everything on your Mac system. And that’s all for your protection, believe it or not.
Now with the situation you’re seeing, there are some programs like antivirus apps and backup programs that lock themselves in place and then pour digital concrete around them to really ensure that no other program can sneakily replace them. And it can be a pain to delete ’em.
So your first step is to check with the vendor: do they have an uninstall program? If they do, use that.
If not, well, let’s try some things…
First off, since CrashPlan is shutting down and I’ve switched my cloud backup to the faster and less expensive iDrive anyway, let’s get rid of CrashPlan on my own Mac system. A click to Trash the app and here’s what I see:
Okay. No panic. First step is to have a closer look, which can be done by choosing the app then using the Command-I “Get Info” shortcut to get this window:
Can you see the fourth checkbox right in the middle of the info window? “Locked”. But not only is it checked, it’s greyed out. This is pretty secure! One thing you can try is opening up the “Sharing & Permissions” pane and clicking on the padlock to unlock access:
You can see the padlock above. Usually the first entry is something like “(Me)” which means you could unlock the file or folder (remember, Mac apps are really folders) then grant yourself read & write, then uncheck the locked box. But not in this case. Sooo… it’s time to open up the Terminal and type commands in directly.
You’ll find the Terminal app in Applications > Utilities and it’s a good program to know as it can be quite useful [and fun: Check out my top rated book Learning Unix for MacOS X from O’Reilly]. For now, the few commands you’ll need are “cd” to change directories to where the app, file or folder can be found, “chflags” to change that darn locked flag, then “rm” to remove the program or file. Oh, and “sudo” to convince the Mac to let you change those permissions in the first place.
In this case, I know /Applications is the command line equivalent of the top-level Applications folder, so here are exactly the commands I used to move to the CrashPlan app, unlock it, and remove the entire package:
Be careful, particularly with that last command, because there’s no backing up, no undo, no changing your mind. But that’s how you remove a file, folder or program that just refuses to be removed. Because, hey, it’s your darn computer, right? 🙂
Pro Tip: While you’re here, do check out the extensive MacOS X Help area and peek in to the Mac Command Line Help area too.
Hi
I am using 13.0 OS,and I am unable to delete app which is locked
When i applied the above commands and even sudo rm -rf .it doesn’t work and gives error
Operation not permitted
on all directories.
thank u
I have deleted FortiClient.app from my macbook. It does not display under launchpad after that but ‘FortiClientUninstaller.app’ is still available in ‘/Applications/’ directory. How to remove it also? Kindly suggest. Thanks.
This might be helpful: https://support.crisisservicescanada.ca/hc/en-us/articles/360054387812-Forticlient-Removal-MacOS
Thanks !
This also worked with the Code42.app (which is what CrashPlan is now called since that is the actual company’s name 🙂 ) – THANK YOU!
THANK YOU! Followed your directions exactly and it worked to delete CrashPlan!
Well, I forgot the password. What could I do?
OK< I put in my password. It still said "Permission denied", "Directory not empty". What's gone wrong?
Try:
sudo rm -rf CrashPlan.app/
I had the same problem. Adding “sudo” (and reentering my password) did the trick for me.
Please be very careful with that sudo rm -rf command. It’s powerful and can easily remove so much of your file system that it damages the operating system itself. In fact, I would suggest NOT using this command unless you’re 100% sure you know exactly what it does…
I had to use sudo to remove the CrashPlan app as in:
sudo rm -fr /Crashplan.app/
otherwise it would no work.
sudo rm -rf is definitely bringing the big guns. One tiny typo, like sudo rm -rf / Crashplan.app/ would destroy your system. I recommend EXTREME caution with command line invocations of this nature, Hans, but am glad it worked out for you.
I’m trying to remove Karabiner-EventViewer.app and Karabiner-Elements.app and I feel I’m kinda screwed as it’s asking for a password even as I try your suggestion and Dave Taylor’s! Why such an app would lock itself and not allow me to unlock makes me incredibly suspicious.
Wow same here!! Trying many different ways to deal with it but still failed
That works for me thank you ! awesome works
WOW. Just WOW. This was the first article I have found that helped me get rid of that pesky Crashplan!! Well done!
It’s been a few years, but finally found something that worked to get rid of CrashPlan!
I tried to use sudo rm -rf but it said operation not permitted. What can I do?
Is the file on a drive that’s mounted read-only? Otherwise, you might need to use a second computer and just mount your system’s hard drive as external. Complicated.
CrashPlan was impossible to remove but I was FINALLY able to do it with your help, thank you!