If you have followed all the advice in the Knowledge Base articles “Mac OS X: About Trash, Deleting Locked Files – Article ID:106272” and “Mac OS X: Troubleshooting Permissions Issues” and are still unable to empty the Trash, or move an item to the Trash, you may have an immutable flag set on one of the items. The first thing to do is investigate the problem further.
Finding the Problem File(s) or Folder(s)
Open the Terminal program (from /Applications/Utilities). If an item cannot be moved to the Trash make sure it and the Terminal window are simultaneously visible. Then type:
followed by a space. Do not press return yet. Then drag the offending file into the Terminal window – its full pathname will appear after your typing. Now press return. Alternatively if the offending item is in the trash you can type:
ls -aolR .Trash
ls -aolR /Volumes/*/.Trashes
where the last line is only necessary if you have additional volumes (partitions or extra hard disks).
For each file and folder you will see a line like:
-rwxr-xr-x 1 username staff uchg 0 Sep 17 10:47 filename
Normal files will have a ‘-‘ in place of ‘uchg’. The ‘uchg’ indicates the ‘User Immutable flag’. This corresponds to the normal Finder lock on the file or folder and can be cleared by the procedures given in the Knowledge Base Articles, particularly 106272.
Alternatively, since you are already in the Terminal, you can type
sudo chflags -R nouchg .Trash
if the item is in the trash. If it is elsewhere, like on the Desktop, just type
sudo chflags -R nouchg
Do not press return yet. Type a space after that text, then drag the offending file/folder into the Terminal window–the system will fill in the full path name. In either case, supply your admin password when prompted – it will not be echoed, just type it and press return. Then quit Terminal and reboot.
If however you see a line like:
d——— 2 root wheel schg 68 Oct 19 2001 ????????????HFS+ Private Data
then the System Immutable flag is set, and you cannot deal with this from the Terminal, even with root privileges. You must instead use single-user mode to change that flag, as described in the accompanying FAQ, Resetting the System Immutable Flag.