After motherboard replacement and system upgrade to Mojave my Mac was restored from backup including some macports codes in /opt . Since macports would not work properly I had to rename /opt/local to /opt/local.OLD and reinstall. The problem is I cannot remove /opt/local.OLD despite all privileges. Any advice/suggestions?

(BTW: all directories are empty)

drwxrwxrwx   3 root  wheel   96 Oct 22 09:01 local.OLD

%sudo rm -rf local.OLD
rm: local.OLD//var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/databases/pxlib: Directory not empty
rm: local.OLD//var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/databases/tokyocabinet-java: Directory not empty
rm: local.OLD//var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/databases/rethinkdb: Directory not empty
rm: local.OLD//var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/databases: Directory not empty
rm: local.OLD//var/macports/sources/rsync.macports.org/macports/release/tarballs/ports: Directory not empty
rm: local.OLD//var/macports/sources/rsync.macports.org/macports/release/tarballs: Directory not empty
rm: local.OLD//var/macports/sources/rsync.macports.org/macports/release: Directory not empty
rm: local.OLD//var/macports/sources/rsync.macports.org/macports: Directory not empty
rm: local.OLD//var/macports/sources/rsync.macports.org: Directory not empty
rm: local.OLD//var/macports/sources: Directory not empty
rm: local.OLD//var/macports: Directory not empty
rm: local.OLD//var: Directory not empty
rm: local.OLD/: Directory not empty

closed as off-topic by Kusalananda, RalfFriedl, Archemar, schily, Jeff Schaller Oct 29 '18 at 15:33

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Kusalananda, RalfFriedl, Archemar, schily, Jeff Schaller
If this question can be reworded to fit the rules in the help center, please edit the question.

  • For each of the directories at the bottom of the hierarchy that can't be deleted, what does ls -l@ea show? – Kusalananda Oct 27 '18 at 20:59
  • %ls -l@ea total 0 drwxrwxrwx 4 root 505 128 Aug 22 2017 . drwxrwxrwx 5 root 505 160 Oct 8 20:07 .. – user3446017 Oct 29 '18 at 0:52
  • %!ls ls -l@ea total 0 drwxrwxrwx 5 root 505 160 Oct 8 20:07 . drwxrwxrwx 3 root 505 96 Oct 8 20:08 .. drwxrwxrwx 4 root 505 128 Aug 22 2017 pxlib drwxrwxrwx 4 root 505 128 Aug 22 2017 rethinkdb drwxrwxrwx 4 root 505 128 Aug 22 2017 tokyocabinet-java – user3446017 Oct 29 '18 at 0:54
  • Juts removed with Finder by putting it into Trash and it worked. Why unix rm -rf did not work is hard to figure – user3446017 Oct 29 '18 at 1:21

Browse other questions tagged or ask your own question.