How to Fix cowardly refusing to Sudo error in Brew–mac OS X

Source: Internet
Author: User
Tags mcrypt

It is a common error this users generally encounter when they try to execute a brew command as sudo and shown below are an Example of 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 a brew with sudo and only if the brew executable are owned by root.
However, this is both not recommended and completely unsupported so does at
Your own risk.

First find out what's the current ownership of the installed package of brew (you'll 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 are had found out in step 1 above

sudo chown: ' Chown brew '

How to Fix cowardly refusing to Sudo error in Brew–mac OS X

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.