brew update fails on El Capitan 10.11.3 - homebrew

When updating homebrew with brew update, I get the following :
Error: Fetching /usr/local failed!
After some digging out and brew doctor recommendations I did this :
sudo chown -R $(whoami) /usr/local
It's still not working.
Please help what to do.

Related

Can't link pcre thru brew in max os yosemite

When I install watchman using brew install watchman, it got this Error: You must brew link pcre before watchman can be installed. So I try brew link pcre and brew link --overwrite pcre, I just got
linking /usr/local/Cellar/pcre/8.36...
Error: Could not symlink share/man/man3/pcre.3
/usr/local/share/man/man3 is not writable.
Can anyone help?
By design Homebrew (brew) requires the contents of /usr/local to be owned by you. You can fix it easily by running:
sudo chown -R `whoami` /usr/local
from your Terminal.
See here for further explanation.
first
sudo chown -R 'your name' /usr/local
then
brew link pcre -f
then
brew install watchman
it should work

FlowType not installing with Brew

I can't get FlowType to install on Mac OS using brew. I typed:
$> brew update
...
$> brew install flow
Error: You must `brew link objective-caml' before flow can be installed
$> brew link objective-caml
Linking /usr/local/Cellar/objective-caml/4.02.1_2...
Error: Could not symlink share/man/man3/Weak.S.3o
/usr/local/share/man/man3 is not writable.
$>
What's wrong?
Please Try change Permission
sudo chown -R $USER /usr/local/lib
The official installation method for flow is locally per-project using yarn (or npm).
yarn add --dev flow-bin
OR
With npm:
npm install --save-dev flow-bin
See the full instructions at https://flow.org/en/docs/install/

Cannot brew link libtool

Ive installed imagemagick on Yosemite, but during the installation I got this error...
Linking /usr/local/Cellar/libtool/2.4.2...
Error: Could not symlink share/info/libtool.info
/usr/local/share/info is not writable.
I have tried brew link libtool but get the same error
I have tried running brew doctor and brew prune
What else can I do to try and get this installed correctly?
Try this:
$ sudo chown -R $USER /usr/local/share/info && brew doctor

brew update and or brew doctor throwing errors

When I try brew update, I get the following error. How can I fix it
~$ brew update
Error: undefined method `close!' for nil:NilClass
Please report this bug:
https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Troubleshooting.md#troubleshooting
/usr/local/Library/Homebrew/extend/pathname.rb:129:in `ensure in atomic_write'
/usr/local/Library/Homebrew/extend/pathname.rb:129:in `atomic_write'
/usr/local/Library/Homebrew/cmd/untap.rb:42:in `unlink_tap_formula'
/usr/local/Library/Homebrew/cmd/update.rb:24:in `update'
/usr/local/Library/brew.rb:136:in `<main>'
Here is the exact issue closed on homebrew github repo brew update gives NilClass error.
So here's how I got it working:
Full uninstall of brew. For me I just wiped my /usr/local directory
as this is a clean machine at the moment.
Full uninstall of RVM.
Make sure my command line tools are up to date "xcode-select --install"
su to admin account and install Homebrew
update /usr/local and all sub files/dirs to have my account as owner - "sudo chown -R jmcdonald ."
"brew install ..." for all of these RVM/Ruby required libs: autoconf,
automake, libtool, apple-gcc42, libyaml, libxslt, libksba, openssl
(apple-gcc42 gave me errors but doesn't seem to have impact).
Exit su and install RVM.
Install a ruby: "rvm install 1.9.3"
I would guess I could have gotten it working without removals but wanted to make sure I had a clean setup.

Error: Cowardly refusing to `sudo brew install` for installing glue 0.3 for Mac OSX Mountain Lion

I'm trying to install glue 0.3 for OXS Mountain Lion and ran into this error after installing homebrew (Error: Cowardly refusing to sudo brew install 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.) I got this error after the first step for installing glue 0.3 ($ sudo brew install jpeg). No idea how to fix this...please help!
sudo chown root /usr/local/bin/brew
sudo chown -R $USER /usr/local
Use the above command instead of changing the owner of brew to root.
This is the suggested method by the Owner of homebrew in https://github.com/Homebrew/homebrew/issues/9953
Answered by the developers here:
https://github.com/Homebrew/homebrew/issues/9953
I solved it by NOT using sudo, and changing the permissions on whatever file it says cannot be accessed without sudo.
For example, I could not access /usr/local/Cellar, so I entered the following (as specified here: https://github.com/Homebrew/homebrew/issues/3930)
sudo chmod g+w /usr/local/Cellar
sudo chgrp staff /usr/local/Cellar
For High Sierra macOS 10.13.3 or newer.
None of the solutions given here worked for me on this version. The only (and the best) fix is to uninstall brew and install it again with the following terminal commands. Note you will lose your current kegs, so you should get a list of the installed kegs, for reinstalling them after reinstalling brew as shown below under step 1. Actually, this was a good opportunity for me to get rid of those kegs that I am no longer using:
List your current kegs for reinstalling, those you wan't to keep:
brew list
Uninstall brew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Reinstall brew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Optionally to prevent your usage being sent to Google Analytics (Update: Fortunately, now this has been stopped, so you may skip this step):
brew analytics off
Finally reinstall your previous kegs from step 1 (or those you still want to use). Replace the text with the square brackets with the list, (i.e. brew install sqlite heroku ):
brew install [list of kegs from step 1]
I have updated my macos to sierra and npm stopped working. Below are the steps followed to fix them.
Uninstall Node and install it from brew and follow the below steps
sudo chmod g+w /usr/local/Cellar
sudo chgrp staff /usr/local/Cellar
sudo chown root /usr/local/bin/brew
sudo brew postinstall node
This was helpful for me
http://digitizor.com/fix-cowardly-refusing-sudo-error-brew/
As quoted in the text, you essentially have to change the user and group of brew to root and wheel respectively.

Resources