码迷,mamicode.com
首页 > 系统相关 > 详细

How To Fix Cowardly Refusing to Sudo error in Brew – Mac OS X

时间:2015-06-10 13:53:34      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:

It is a common error that users generally encounter when they try to execute a brew command as sudo and shown below is an example of how the error looks like:

Debjit-Sahas-Mac-mini:mcrypt debjit$ sudo brew link mcrypt
Password:
Sorry, try again.
Password:
Error: Cowardly refusing to `sudo brew link`
You can use brew with sudo, but only if the brew executable is owned by root.
However, this is both not recommended and completely unsupported so do so at
your own risk.

 

 

First find out what is the current ownership of the installed package of brew (you will need this info in the last step)

ls -al `which brew`

Change the user and group of brew to root and wheel respectively:

sudo chown root:wheel `which brew`

Now execute your brew command as root, for eg. sudo brew link mcrypt. Lastly, revert back the ownership of brew to what you had found out in step 1 above

sudo chown : `chown brew`

How To Fix Cowardly Refusing to Sudo error in Brew – Mac OS X

标签:

原文地址:http://www.cnblogs.com/MDK-L/p/4565719.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!