macOS Ventura doesn't let me delete "Install macOS Mojave.app"
Some weeks ago I downloaded macOS Mojave from the App Store to install on a VMware virtual machine. When the installation process finished I moved the "Install macOS Mojave.app" file from Applications to the Trash. After some days when trying to empty the trash I was presented with the following surprise: The operation can't be completed because the item "Install macOS Mojave.app" is in use.
I decided to move the file from the Trash to a newly created folder "A" on the Desktop. I then tried running this from Terminal:
sudo rm -rf /Users/XXXX/Desktop/A/Install\ macOS\ Mojave.app
I just got:
rm: /Users/XXXX/Desktop/A/Install macOS Mojave.app/Contents/SharedSupport/InstallESD.dmg: Operation not permitted
rm: /Users/XXXX/Desktop/A/Install macOS Mojave.app/Contents/SharedSupport: Directory not empty
rm: /Users/XXXX/Desktop/A/Install macOS Mojave.app/Contents: Directory not empty
rm: /Users/XXXX/Desktop/A/Install macOS Mojave.app: Directory not empty
I checked the file info and the file isn't locked (that box isn't checked and it's grayed out). I even added my user to the permissions box with write/read without any luck.
Under Terminal I also tried lsof /Users/XXXX/Desktop/A/Install\ macOS\ Mojave.app and nothing was shown.
I have rebooted and it didn't help.
Neither Activity Monitor nor Force Quit shows anything related to the file.
I booted into Safe mode and tried to delete the file from there, just received the same errors as in normal mode.
I then tried to move this folder containing the rebel file to an external USB stick and got the message that the item was copied but couldn't be moved.
This file is turning me crazy. It is almost 6GB of wasted space and I don't understand why macOS doesn't let me delete the freaking thing.
I am now empty of options.
Ideas are greatly appreciated thank you.
Using macOS Ventura 13.2 atm here.
MacBook Pro