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? 🙂