I had the problem that two installers for Macos were in the Trash, but couldn't be deleted.\
Trying to delete from the command line with sudo just yielded an Operation not permitted error.
The soluction came from this apple discussion
- Reboot into Recovery (reboot and hold down Apple-R until you see the Apple logo)
- Open a Terminal (Utilties menu)
- Type
csrutil disableto disable the System Integrity Protection that is blocking deleting the installers. - Reboot
- Empty Trash
- Reboot into Recovery again
- Open a Terminal
- Type
csrutil enableto re-enable SIP - Reboot.