Emptying the Trash on your Mac should be one of the simplest actions you can perform. But occasionally, when you try to delete a file or empty the bin, macOS suddenly throws up a roadblock in the form of a pop-up: "The operation can't be completed because an unexpected error occurred (error code -8072)."
Mac Error Code 8072 is fundamentally a permissions and file-locking error. It happens when macOS is trying to delete a file, but something else on the system is actively holding onto it, or the system believes you do not have the proper security clearance to destroy it.
While encountering an undeletable file can be highly frustrating, Error 8072 is very rarely a sign of hardware failure. In this guide, we will walk you through the reasons this error occurs and provide several escalating methods to force your Mac to delete the stubborn files once and for all.
What Causes Error Code 8072?
To fix Error 8072, it helps to understand why macOS is refusing to delete the file in the first place. The operating system is designed to protect crucial files from accidental deletion, and sometimes this protection mechanism gets a little overzealous. The most common causes include:
- The File is In Use: The most frequent cause of this error is that a background application or system process is currently reading or writing to the file you are trying to delete. macOS locks files that are in use to prevent data corruption.
- Corrupted Permissions: Every file on your Mac has "permissions" that dictate who can read, write, and execute it. If these permissions become corrupted, the system may mistakenly believe you (the admin user) do not have the right to delete the file.
- Time Machine Interference: If you use Time Machine for backups, it occasionally creates hidden local snapshots of files. If you try to delete a file that Time Machine is actively backing up or referencing, it can trigger Error 8072.
- The File is Locked: macOS allows users to manually "lock" files via the Get Info panel. A locked file cannot be moved to the Trash or deleted until it is unlocked.
Step 1: Check if the File is Locked
Before moving to more complex troubleshooting steps, you should always check the simplest explanation first. A file might just be manually locked.
- Open the Trash bin or locate the file you are trying to delete.
- Right-click (or Control-click) on the stubborn file and select Get Info.
- In the Get Info window, look for the General section.
- Look for a checkbox labeled Locked. If it is checked, uncheck it.
- Close the Get Info window and try to empty the Trash again.
Step 2: Force Empty the Trash
If the file isn't locked, but macOS is still throwing Error 8072 when you try to empty the Trash, you can attempt to "Force Empty" the bin. This command tells macOS to override minor file-in-use warnings and delete the contents anyway.
- Open the Trash bin so you can see the files inside.
- Hold down the Option (Alt) key on your keyboard.
- While holding the Option key, click the Empty button in the top right corner of the Trash window.
If a dialog box appears asking if you are sure you want to permanently erase the items, click Empty Trash while continuing to hold the Option key.
Step 3: Restart Your Mac (Safe Mode)
If holding the Option key didn't work, it is highly likely that a hidden background process is actively using the file. Because it can be very difficult to figure out exactly which app is holding the file hostage, the easiest solution is a complete system restart.
To be absolutely thorough, you should restart your Mac in Safe Mode. Safe mode prevents unnecessary third-party apps and startup items from loading, which ensures that whatever was holding onto your file won't be running when the Mac boots back up.
For Apple Silicon Macs (M1/M2/M3):
- Shut down your Mac completely.
- Press and hold the Power button until "Loading startup options" appears.
- Select your main startup disk.
- Press and hold the Shift key, then click Continue in Safe Mode.
For Intel Macs:
- Restart your Mac and immediately hold down the Shift key.
- Release the Shift key when you see the Apple logo and login screen.
Once you are booted into Safe Mode, open the Trash and try to empty it again. If it succeeds, restart your Mac normally.
Step 4: Use Terminal to Force Delete the File
If all the standard graphical interface methods have failed, you can use the Terminal app to force macOS to delete the file at the root system level. This bypasses almost all permission checks and file locks.
rm -rf command is incredibly powerful and unforgiving. It will permanently delete whatever you tell it to without asking for confirmation. Follow these steps exactly, and be very careful not to delete the wrong files.- Open Launchpad, type Terminal, and open the app.
- Type the following command into Terminal, making sure to include a single space at the very end (do not press Return yet!):
sudo rm -rf - Open your Trash bin (or the folder containing the stubborn file).
- Click and drag the stubborn file from the Trash directly into the Terminal window. You will see the file's path automatically populate at the end of your command.
- Your Terminal command should now look something like this:
sudo rm -rf /Users/YourName/.Trash/StubbornFile.ext - Press Return.
- Terminal will ask for your administrator password. Type it in (the characters will not show up on screen for security reasons) and press Return again.
The file will be immediately and permanently deleted, resolving Error 8072.
Step 5: Turn Off Time Machine (Temporarily)
If the Terminal method gives you an "Operation not permitted" error, the file is likely being protected by macOS's System Integrity Protection (SIP) because Time Machine considers it a crucial backup file.
Time Machine creates "Local Snapshots" on your hard drive to speed up the backup process. If you are trying to delete a file that is tied up in a pending snapshot, Error 8072 will occur.
- Open System Settings and navigate to General > Time Machine.
- If automatic backups are turned on, toggle them Off.
- Wait a few minutes to allow macOS to clear out its pending local snapshots.
- Try emptying the Trash again.
- Once the Trash is empty, remember to turn Time Machine back on so your backups continue.
Conclusion
Mac Error Code 8072 is a stubborn permissions issue that prevents you from deleting files, but it is easily overcome. By checking for locked files, forcing the Trash to empty, utilizing Safe Mode, or deploying the Terminal for a brute-force deletion, you can reclaim your storage space and keep your Mac running smoothly.


