Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

markfc

macrumors 65816
Original poster
Sep 18, 2006
1,081
3,093
Prestatyn, Wales, UK
Screenshot 2023-08-29 at 13.33.20.png

Please can you help me delete these two installer files.
I've moved them to trash but when I try and empty trash it says they are in use.
They're not mounted and not showing up in disk utility.
I've rebooted and tried in safe mode - same thing.
Tried from the terminal but no joy.
Thanks
 
Thanks for coming back to me!

I have tried this before but I get this message ;

Password:
override rw-r--r-- root/wheel restricted for /Users/mark/.Trash/death/Install macOS Sierra.app/Contents/SharedSupport/InstallESD.dmg? y
rm: /Users/mark/.Trash/death/Install macOS Sierra.app/Contents/SharedSupport/InstallESD.dmg: Operation not permitted
rm: /Users/mark/.Trash/death/Install macOS Sierra.app/Contents/SharedSupport: Directory not empty
rm: /Users/mark/.Trash/death/Install macOS Sierra.app/Contents: Directory not empty
rm: /Users//.Trash/death/Install macOS Sierra.app: Directory not empty
override rw-r--r-- root/wheel restricted for /Users/mark/.Trash/death/Install macOS Catalina.app/Contents/SharedSupport/InstallESD.dmg? y
rm: /Users/mark/.Trash/death/Install macOS Catalina.app/Contents/SharedSupport/InstallESD.dmg: Operation not permitted
rm: /Users/mark/.Trash/death/Install macOS Catalina.app/Contents/SharedSupport: Directory not empty
rm: /Users/mark/.Trash/death/Install macOS Catalina.app/Contents: Directory not empty
rm: /Users/mark/.Trash/death/Install macOS Catalina.app: Directory not empty
rm: /Users/mark/.Trash/death: Directory not empty
Marks-MacBook-Pro-2:test mark$
 
The OP's post reminded me I'd recently downloaded the Mojave installer app. I tried 'sudo rm....' also (I'm pretty familiar with the command line) and had the same result.

The problem is that the 'InstallESD.dmg' file has the flag: "restricted", as one can see with 'ls -lO'. From what i've read files with that flag are under control of SIP, which normally requires disabling SIP for removal.

Moving to /tmp and rebooting sounds easier -- I'll give it a try!
 
  • Like
Reactions: markfc
The OP's post reminded me I'd recently downloaded the Mojave installer app. I tried 'sudo rm....' also (I'm pretty familiar with the command line) and had the same result.

The problem is that the 'InstallESD.dmg' file has the flag: "restricted", as one can see with 'ls -lO'. From what i've read files with that flag are under control of SIP, which normally requires disabling SIP for removal.

Moving to /tmp and rebooting sounds easier -- I'll give it a try!
It definitely worked for me. Hope it works for you.
 
I did manage to do it though. I found a post of a similar issue.

I moved them to /Tmp and restarted and they disappeared.

Yup, moving "Install macOS Mojave.app" to /tmp and rebooting got rid of it!

Probably no one cares now, but a year later I've found out that a 5.2 GB file within "Install macOS Mojave.app" never got deleted. The idea of putting the installer into /tmp and rebooting still can't delete it -- it just gets moved! What happens is that macOS moves it to a subdirectory within /private/var/dirs_cleaner, where it lingers forever. Mine was put in /private/var/dirs_cleaner/QT/x7 I thought it was deleted, but it wasn't.

The problem is that this file:
Install macOS Mojave.app/Contents/SharedSupport/InstallESD.dmg has the "restricted" file flag set.

You can see a file's flag values with ls -lO (that is capital-letter-oh)

It seems that the only way to delete a file that has the "restricted" flag is to disable SIP, delete the file, and re-enable SIP, at least in Monterey. Anyway, NOW I have my 5.2 GB back!
 
  • Like
Reactions: markfc
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.