35

I had to make a bootable macOS High siera install, everyhing went well and it worked. I'm trying to remove the app that I used to install it and trash won't let me. Everytime I try I get an

The operation can’t be completed because the item 
“Install macOS High Sierra.app” is in use.

error. I tried to circumvent this by option+click and selecting "Delete immediately" but that just gives me an

“InstallESD.dmg” can’t be modified or deleted because it’s required by macOS.

error. Any help for getting this thing off my computer will be greatly appreciated.

R. Gillie
  • 523
  • 1
  • 4
  • 9
  • An observation on when this happens: I downloaded the install apps for High Sierra, Mojave, Catalina, and Big Sur. The first three all gave me an error saying that the install app could not be run. Big Sur ran, and I quit it. I was able to delete Big Sur, no problem. But the other three could not be deleted. It seems that the dmg was mounted for those, but when the app failed to run, those dmg's were somehow marked as mounted in permanent way. Even though they don't show up as mounted, where this apparent mark survives a reboot. (This is all on the latest Big Sur, 11.2.1.) – Mark Adler Feb 11 '21 at 07:15

5 Answers5

28

I was experiencing this problem after downloading High Sierra to fix a friend's Mac. I found Rick's solution worked for me, but I've added a few more steps.

  1. Click the  symbol in the Menu bar.

  2. Click Restart….

  3. Hold down Command + R to boot into Recovery Mode.

  4. Click Utilities.

  5. Select Terminal.

  6. Type csrutil disable. This will disable SIP.

  7. Press Return or Enter on your keyboard.

  8. Click the  symbol in the Menu bar.

  9. Click Restart….

Extra Steps

  1. Log in / boot up the Mac.

  2. Empty Trash.

I also found that somehow Previous System folder appeared under the Mac HD. So I also trashed that (which wouldn't trash previously).

I then rebooted the Mac a few times to check that everything was working fine. Then rebooted into recovery mode.

  1. Hold down Command + R to reboot into Recovery Mode.

  2. Click Utilities.

  3. Select Terminal.

  4. Type csrutil enable. This will enable SIP.

  5. Press Return or Enter on your keyboard.

  6. Click the  symbol in the Menu bar.

  7. Click Restart….

Nimesh Neema
  • 51,809
Matt80
  • 320
  • You don't need to reboot with SIP disabled, see other answer. – MarcH Mar 27 '19 at 21:59
  • I just used this answer to remove a Mojave installer that would not delete from a Big Sur OS. I had created a bootable installer for Mojave that somehow stayed around and would not delete. Thanks. – armand Dec 10 '20 at 08:28
  • @MarcH Yes you require to reboot with SIP disabled – alper Sep 18 '21 at 12:05
  • 1
    This answer disables SIP. I followed Martin B's different answer and it worked without disabling SIP. – MarcH Sep 21 '21 at 05:27
  • Too complicated with possible security implications. May require owner privileges (firmware password). – igraczech Jan 08 '24 at 10:06
14

Fastest way to fix this is the following.

  1. Reboot
  2. Hold Cmd + R
  3. Choose language
  4. If you are using an encrypted disk, select "disk utility" then select the disk where the unremovable files are located, and mount it. Once this has been mounted, quit disk utility.
  5. In the Utilities menu select Terminal
  6. Type cd .. as many times that are needed until you can see /Volumes
  7. Type ls to see if you are where /Volumes is present
  8. Type cd Volumes
  9. Type ls to see name of harddrive
  10. Type cd *nameofharddrive*/Applications
  11. Type rm -r Install (press tab to write out the whole filename)
  12. Press enter to delete
  13. Reboot
nohillside
  • 100,768
Martin B
  • 149
  • 1
  • 3
  • Yes it's much faster however it's missing one step: unlock and mount the encrypted hard drive with "Disk Utility" first before opening a Terminal. Cause you're not crazy enough not to encrypt your hard drive, right? :-) – MarcH Mar 27 '19 at 21:58
  • This worked for me. I was able to just type cd "/Volumes/Macintosh HD - Data" after mounting the Data partition of my hard drive. – hrunk Jan 07 '22 at 22:01
  • This method still works on macOS 12.6 Monterey (which saved an extra reboot to disable/reenable SIP). The method below ("2. Re-download respective installer [...] overwriting the broken installer") did not work on Monterey. – tompark Jun 23 '23 at 21:30
  • Too complicated with possible security implications. May require owner privileges (firmware password – igraczech Jan 08 '24 at 10:06
12

UPDATE!

I have found another simple solution in case rebooting in Recovery mode is not an option for you (e.g. you've forgotten the firmware password like me):

The usual suspect (macOS) itself has full root privileges when erasing the /tmp/ folder contents on each reboot as expected. This feature can be used to solve the issue with undeletable hanging files:

  1. Move the offending Mac OS X installer back from Trashes to /tmp/

  2. Reboot, and the offending file is gone.

I couldn’t solve this issue for 4 years (yeah, so stupid, isn’t it) until it strucked me yesterday evening, having 4 Monterey installs on my 250G MB from 2015.

igraczech
  • 218
  • 2
  • 6
3

What happened was the installer was getting caught by Mojave's system update panel in the system preferences.

Just had to disable SIP and it deleted okay with no issues to the computer after.

R. Gillie
  • 523
  • 1
  • 4
  • 9
  • 1
    What is a SIP? I really don't know. Can you make this a bit easier to apply (for others, too!) as an answer? – esaruoho Nov 19 '18 at 00:02
  • SIP is System Integrity Protection. You really should not disable this, other solutions are much safer. But here's some more info anyway: https://developer.apple.com/library/archive/documentation/Security/Conceptual/System_Integrity_Protection_Guide/ConfiguringSystemIntegrityProtection/ConfiguringSystemIntegrityProtection.html – Aron Jul 18 '19 at 15:31
2

Apple has changed how this is managed since this answer was added. Leaving for those using older versions of the OS where this worked.

I ran into this recently on a machine running macOS Mojave (10.14.x), where I was running low on disk space, and still had this installer.

The built-in Storage Management application should allow you to find the item in the Applications panel and you can delete it from there. I personally found right-clicking on the item and selecting Delete to be more responsive than selecting it and using the button.

Accessible on Sierra and later by:

  1. Apple icon > About this Mac
  2. Storage tab > Manage...
  3. Select the Applications tab and find the item in the listing
  4. Right-click on the item and select delete, or select the item and use the Delete... button.

Disabling Systems Integrity Protection (SIP) was not required, nor was a reboot.

James Skemp
  • 141
  • 6