I'm trying to delete "Install macOS Mojave.app" from my Mac using the terminal command sudo rm -r or rm -rf, but it reports root error/illegal option/directory permission restricted, etc.
What can I do? I paste here some process:
albertop@192 ~ % sudo rm -rf /Users/albertop/Desktop/Install\ macOS\ Mojave.app
rm: /Users/albertop/Desktop/Install macOS Mojave.app/Contents/SharedSupport/InstallESD.dmg: Operation not permitted
rm: /Users/albertop/Desktop/Install macOS Mojave.app/Contents/SharedSupport: Directory not empty
rm: /Users/albertop/Desktop/Install macOS Mojave.app/Contents: Directory not empty
rm: /Users/albertop/Desktop/Install macOS Mojave.app: Directory not empty
albertop@192 ~ % ls -l/Users/albertop/Desktop/Install\ macOS\ Mojave.app
ls: illegal option -- /
usage: ls [-@ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1%] [file ...]
albertop@192 ~ % sudo rm /Users/albertop/Desktop/Install\ macOS\ Mojave.app
Password:
rm: /Users/albertop/Desktop/Install macOS Mojave.app: is a directory
albertop@192 ~ % sudo rm -R /Users/albertop/Desktop/Install\ macOS\ Mojave.app
override rw-r--r-- root/wheel restricted for /Users/albertop/Desktop/Install macOS Mojave.app/Contents/SharedSupport/InstallESD.dmg?
rm: /Users/albertop/Desktop/Install macOS Mojave.app/Contents/SharedSupport: Directory not empty
rm: /Users/albertop/Desktop/Install macOS Mojave.app/Contents: Directory not empty
rm: /Users/albertop/Desktop/Install macOS Mojave.app: Directory not empty
ls -l, before the pathname.