修复humebrew 安装软件 Cowardly refusing to `sudo brew link` 错误
2015-10-26 17:43
441 查看
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.
UPDATE: if you are facing permission issues with HomeBrew on Mac OS X El Capitan, then you should read
this.
There is a simple fix associated with this. Just go ahead and execute the following four commands in that order:
Homebrew Logo - Mac OS X
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`
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.
UPDATE: if you are facing permission issues with HomeBrew on Mac OS X El Capitan, then you should read
this.
There is a simple fix associated with this. Just go ahead and execute the following four commands in that order:
Homebrew Logo - Mac OS X
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`
相关文章推荐
- 系统全局对话框显示
- 解决子级用css float浮动,而父级div不能自适应高度问题
- C++:类的创建
- Python Delegate抽象超类
- UITextField的placeholder文字的位置,颜色等的自定义设置
- 分享到朋友圈的app store下载链接被微信屏蔽
- Linux下Service守护进程开发和Shell脚本控制Daemon
- ELK学习5_ELK文档资料:《ELK stack 权威指南/饶琛琳》推荐
- ios中自定义cell 设置cell的分组结构
- awk 精萃
- 前后端分离的思考与实践(三)
- django1.7版本以上创建表
- 【bzoj3251】【树上三角形】【暴力】
- 全选与删除
- 关于mongodb慢查询
- 通过JDBC进行简单的增删改查(以MySQL为例)
- MessageDigest简介
- iOS—OC——runtime
- 软件测试发展规划
- 基础篇(十) Fragment和Activity