Permission denied - /usr/local/bin/pkill.pl

Tag: unix , homebrew Author: tzlxz103 Date: 2012-11-22

I'm installing Homebrew and when I run brew doctor it prompts:

Error: Permission denied - /usr/local/bin/pkill.pl

I've tried: $ sudo chmod 755 /usr/local/bin/pkill.pl (also other options: 777, a-x, ...I don't know which is need it for brew)

but when ls, still:

ls: ./pkill.pl: Permission denied lrwx------ 1 root wheel 23 11 feb 2012 pkill.pl ...

Could you tell me how to solve it? Thank you!

Best Answer

That first character in the directory listing (l) means the file is a symbolic link to another file. Use ls -l to find out which. It's most likely the permissions on that file that are the problem. The permissions for links are normally 755 (read and execute all users and write for owner).

comments:

Thank you @Dunes. I've tried ls -l and still.. see and example: lrwxr-xr-x 1 root wheel 61 12 oct 16:46 pip-2.7 -> /Library/Frameworks/Python.framework/Versions/2.7/bin/pip-2.7 lrwxr-xr-x 1 mcasandrariera admin 42 8 dic 13:07 pkg-config -> ../Cellar/pkg-config/0.27.1/bin/pkg-config ls: ./pkill.pl: Permission denied lrwx------ 1 root wheel 23 11 feb 2012 pkill.pl -rwxr-xr-x 1 root wheel 452 3 abr 2011 pphs
Sorry... don't know how to introduce new line separation in comments, but the idea is that, for those I have permissions, the original file to which is linked is shown
I didn't realise homebrew was a package manager. You need to be running any package manager was root (eg. sudo brew doctor). You do not want any user other than root to be able to use pkill, or any user (malicious code) could arbitrarily kill processes on your computer.
Thanks @Dunes and @X.Jacobs. Running sudo brew doctorgave now error (only warning to update Xcode, which is on going...).
sorry, gave me NO error :D