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

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`

时间: 2024-11-08 18:36:56

How To Fix Cowardly Refusing to Sudo error in Brew – Mac OS X的相关文章

How To Fix – Mcrypt PHP extension required in Laravel on Mac OS X (No MAMP)

Laravel PHP web framework requires certain libraries to function properly. One of these libraries is the mcrypt and the php-mcrypt (bridge between mcrypt and php). However, there is a good chance that you will run into issues while running Laravel if

【转】[fix] Wireshark error: There are no interfaces on which a capture can be done. on Mac OS X

I got the following error message when trying to open a network interface for capture using Wireshark on Mac OS X (Wireshark 1.5.1 Intel 64 beta and 1.4.6 Intel 64 show this behaviour): There are no interfaces on which a capture can be done. To solve

Mac OS X 10.10 编译代码出错 fatal error: '__debug' file not found #include <__debug>

1. 错误描述 在mac系统升级到yosemite,或者Xcode版本升级后,在编译c++程序的时候无法通过,错误类型如下: 2. 解决方案 创建一个临时文件"__debug",可以解决这个问题.在命令行中执行以下代码: $ echo '#define _LIBCPP_ASSERT(x, m) ((void)0)' | sudo tee -a /Library/Developer/CommandLineTools/usr/include/c++/v1/__debug > /dev

Mac OS X 10.10 Yosemite PHP 5.5.14 free type support fix

通过将php将至5.4来勉强支持freetype扩展,不推荐此方法 after upgrading to new Mac OS X Yosemite, i noticed that free type support is not working with php 5.5, so i had to downgrade to php 5.4 using homebrew first install Xcode Command line Tool xcode-select --install the

Mac OS安装octave出现的问题-'error:terminal type set to 'unknown'的解决'

学习Machine learning需要使用Octave语言,毕竟吴恩承力荐.本机系统Mac OS X EI Capitan, 其实什么系统都无所谓了,安装原理都是一样的. 在不断才坑中,理清楚了各个软件之间的关系: Octave是一个类似于MATLAB一样强大的语言,相比来说,它是开源的,FREE! Octave中使用了GNUplot来绘制图像,所以需要在电脑上安装gnuplot才能使用它的图像绘制的功能.PS: 我首先在coursera上安装课程资源里面给的链接,安装了Octave,后来发现

Xprog 5.5.1 fix xprog-m 5.0 software error and authorization error

Important Note: I am not stating or encouraging you operate by following the next steps to update from Xprog 5.0 to Xprog 5.5.1 if you do not have knowledge and skills to remove the chip, otherwise it may screw up the chip. The information provided h

How to Install wget in OS X如何在Mac OS X下安装wget并解决configure: error:

1.ftp://ftp.gnu.org/gnu/wget/官网下载最新的安装包 wget-1.19.tar.gz 2.打开终端输入 tar zxvf wget-1.9.1.tar.gz 解压缩 3.进入wget所在文件夹 终端输入cd wget-1.9.1 4.终端输入 ./configure 如果出现configure: error: The pkg-config script could not be found or is too old. Make sure it is in your

Error starting userland proxy: Bind for 0.0.0.0:80: unexpected error (Failure EADDRINUSE) mac下错误记录

架好的环境运行不了,nginx报错,根据提示是80端口被占用. p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; background-color: #ffffff } span.s1 { } ERROR: for eagledock_nginx_1  Cannot restart container affabde5053648c62dbadb0c0e2f44b371e3f0f0c5058e2

Mac OS X El Capitan (10.11) sudo pip install 报错 “OSError: [Errno 1] Operation not permitted”

由于 OS X El Capitan 采用了 System Integrity Protection 保护技术,导致 sudo pip install 安装python包时会产生报错: 1 File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 150, in makedirs 2 makedirs(head, mode) 3 File "/System