Certain files have a property incorrectly set that will prevent them from being changed or deleted while the system is running. That property can only be removed in Recovery mode.
1. Back up all data. There are ways to back up a computer that isn't fully functional. Ask if you need guidance. Don't skip this step.
2. Disconnect all external storage devices.
3. Start up in Recovery mode. Select a language, if prompted. The OS X Utilities screen will appear. One of the options is to install OS X. That's not what you're going to do.
4. This step is only necessary if you use FileVault 2. If you don't know what FileVault is, you're not using it. Go to the next step. Otherwise, launch Disk Utility, then select the icon of the FileVault volume ("Macintosh HD," unless you gave it a different name.) It will be nested below another drive icon. Select Unlock from the File menu and enter your login password when prompted. Then quit Disk Utility to be returned to the main screen.
5. Select Get Help Online. Safari will launch. While in Recovery, you'll have no access to your bookmarks, but you won't need them. Load this web page.
6. Triple-click anywhere in the line below to select it:
chflags norestricted /V*/*/L*/Keyc*/*
Copy the selected text to the Clipboard by pressing the key combination command-C.
7. Quit Safari. You'll be returned to the OS X Utilities screen.
From the menu bar, select
Utilities ▹ Terminal
The Terminal application will launch. Paste into the Terminal window by pressing the key combination command-V.
Wait for a new line ending in a hash sign (#) to appear. Quit Terminal to be returned to the main screen.
8. Select
▹ Restart
from the menu bar.