Why can't I delete this file?

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?

ironsand

Posted 2013-09-19T13:49:19.257

Reputation: 1 757

So when it asked you to override, what did you answer? – Ƭᴇcʜιᴇ007 – 2013-09-19T14:26:55.403

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). – Blacklight Shining – 2013-09-19T14:29:29.077

@Tetsu You mean brew doctor, right? – Blacklight Shining – 2013-09-19T14:32:15.180

@BlacklightShining Ya, as you assume, I just pressed return. I deleted by answering y. Thanks! – ironsand – 2013-09-20T09:52:25.380

@BlacklightShining And yes, I meant brew doctor. – ironsand – 2013-09-20T09:53:24.713

Answers

4

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.

Blacklight Shining

Posted 2013-09-19T13:49:19.257

Reputation: 2 127

1

You need to use sudo...

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

that should do it

djabou136

Posted 2013-09-19T13:49:19.257

Reputation: 11