2

When I run brew doctor, I get this warning:

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
    /usr/local/lib/libusb-0.1.4.4.4.dylib
    /usr/local/lib/libusbpp-0.1.4.4.4.dylib

According to this question and answer, I want to delete these files.

But when I remove the second one with rm, it seems to be recreated automatically:

$ rm /usr/local/lib/libusbpp-0.1.4.4.4.dylib
override rwxr-xr-x  root/wheel for /usr/local/lib/libusbpp-0.1.4.4.4.dylib? 
$ ls /usr/local/lib/libusbpp-0.1.4.4.4.dylib
/usr/local/lib/libusbpp-0.1.4.4.4.dylib

I totally don't understand what's going on. Why can't I delete this file?

5
  • So when it asked you to override, what did you answer? Sep 19, 2013 at 14:26
  • It looks like they just pressed return. I think rm defaults to n when you don't give it a valid reply (or at least when you enter nothing). Sep 19, 2013 at 14:29
  • @Tetsu You mean brew doctor, right? Sep 19, 2013 at 14:32
  • @BlacklightShining Ya, as you assume, I just pressed return. I deleted by answering y. Thanks!
    – ironsand
    Sep 20, 2013 at 9:52
  • @BlacklightShining And yes, I meant brew doctor.
    – ironsand
    Sep 20, 2013 at 9:53

3 Answers 3

5

rm is telling you that you don't have write access to the file you told it to delete, and is asking for confirmation. Type y and then press return when it asks you if you want to override. If you type n or nothing at all, it won't delete the file.


Technical(ish) details:

rwxr-xr-x root/wheel is a representation of the permissions and ownership of the file.

The first part tells you the permissions of the file; the second that the file is owned by the user root and the group wheel.

See man chown for more information on file ownership, and man chmod for more information on file permissions. Wikipedia might have easier-to-understand information on chown and chmod.

1

You need to use sudo...

sudo rm -rf /usr/local/lib/libusbpp-0.1.4.4.4.dylib

that should do it

1

The answer above is accurate for the contents of /usr/local/. MacOS has something called System Integrity Protection, which restricts the actions of superuser. Attempts to alter the contents of /usr/bin and other folders may be rejected with Operation not permitted. This is described in which folders are affected by System Integrity Protection.

1
  • THANK YOU! Among the many answers I've read about this issue, this is the first one I've seen that mentions MacOS's System Integrity Protection, which indeed was what was causing my problem.
    – Asker
    Apr 29, 2023 at 9:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .