How do I change the git origin remote location of Homebrew in Mac OS X 10.8 (mountain lion)? - macos

In setting up my Mac OS X 10.8 Mountain Lion environment (per these instructions), I am running into an issue with Homebrew after installing it and running brew doctor in the shell.
Warning: Suspicious git origin remote found.
With a non-standard origin, Homebrew won't pull updates from
the main repository. The current git origin is:
Unless you have compelling reasons, consider setting the
origin remote to point at the main repository, located at:
https://github.com/mxcl/homebrew.git
How can I change the git origin remote location?

Thanks to this post, I discovered my issue.
When installing Homebrew, it doesn't seem to pull the latest version. After installation, run brew update. Homebrew more recently fixed the "Origin issue" in a later release which is reflected upon updating the installation.

I just upgraded my iMac to 10.9.1 and then did a brew update. After that brew doctor gave me the 'non-standard origin' warning. The post referred to by #tom-geoco didn't really say what was wrong or explain how to manually change the 'origin remote' setting, but, as per #jesdisciple's comment above I just quit the Terminal, run it up again and tried brew doctor and the problem vanished. brew --config now reports ORIGIN: https://github.com/Homebrew/homebrew.git which is correct. Spooky eh?

Comment: (I do not have enough reputation to comment, so please add this and delete this)
brew update
brew doctor -> Suspicious origin error
restart terminal
brew doctor -> Suspicious origin error
brew update
restart terminal
brew doctor -> All ok.
This is how it was for me. I hope this helps someone else out there. Notice that you must run brew update twice to get rid of it.

Related

bash: /home/linuxbrew/.linuxbrew/bin/go: Bad address

I did an brew upgrade and afterwards keep getting an bad address error.
Tried to uninstall/reinstall everything, but cant figure out what is the problem.
bash: /home/linuxbrew/.linuxbrew/bin/go: Bad address
Im new to terminal and linux, so all advice is welcome.
I tried brew doctor. It says "No developer tools installed." and after i 'brew install gcc' it says gcc is already installed and up-to-date.
Use the official Go installation:
Go: Download and install
For full support, avoid OS package managers, Homebrew, and so forth.
First, remove any previous installations by other methods, for example, Homebrew.
Little late, but this post was a suggestion for me when I ran into a similar issue with Go and Brew.
When Brew updates the version of Go (1.19.3 -> 1.19.5 in my case) that it is providing, for some reason it does not correctly update the GOROOT environment varaible. Correcting the value of the variable fixed the issue for me.
export GOROOT=/home/linuxbrew/.linuxbrew/Cellar/go/<go_version>/libexec
# example
export GOROOT=/home/linuxbrew/.linuxbrew/Cellar/go/1.19.5/libexec

How to change Homebrew's prefix?

I'm using MACOS M1, and started to install brew under ARM. Then at the other day, I installed some formula under x86.
When I run a command
brew doctor
And I got this message
Some of Homebrew's bottles (binary packages) can only be used with the default
prefix (/usr/local).
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels. You are responsible for resolving
any issues you experience while you are running this
unsupported configuration.
How to change the prefix to /usr/local/?
When I run which -a brew I got this result
/opt/homebrew/bin/brew
/usr/local/bin/brew
Thanks in advance.
I had the same issue because I did not installed the homebrew from the local path on my terminal.
I just uninstalled the homebrew, installed it again (from the local path this time) and it is fine now.
To uninstall Homebrew, run the uninstall script from the HomeBrew/install repository.

Homebrew Mac Update Issues

This is something that I've noticed starting about 2 days ago. In my past experience, Homebrew would always have daily updates. I would always type the command brew update and voila, there would be packages that would be updated/deleted and Homebrew would display what changed. I also noticed that if I didn't update Homebrew for more than a day, I would get the following notice:
Homebrew hasn't been updated in the last 24 hours. That's a long time in brew land. Type 'brew update.
However, the last time I updated Homebrew on my Mac was on August 10, 2016. Today is August 14, 2016 and when I type brew update, it tells me that everything is already up-to-date, even though I haven't updated Homebrew in 4 days. The update notice in brew doctor also does not show-up. I have not modified Homebrew in any way throughout this whole debacle.
Is there a solution to this Homebrew updating issue or does Homebrew not have daily updates anymore?
According to https://github.com/Homebrew/brew#update-bug
If Homebrew was updated on Aug 10-11th 2016 and brew update always says Already up-to-date. you need to run
cd $(brew --repo); git fetch; git reset --hard origin/master; brew update
Homebrew is basically a git directory, so you can cd into the directory and perform a git fetch followed by a git pull
If you are on default config:
cd /usr/local && git pull origin master
Please run to debug what happens when update
brew update --debug --verbose
brew update --force
My reference from this comment

Git Segmentation fault: 11

I had to reinstall OS X Lion on my Macbook Pro, and upon trying to use git I got an error stating Segmentation fault: 11. No matter what git command I try I get that error. I'm just doing this through the Mac terminal. No fancy programs or anything external.
I uninstalled git and just to make sure it was uninstalled I typed git init and it gave me a command not found message.
I reinstalled git and I'm still getting the segmentation fault message. I get the message regardless of what directory I'm in and what command I use.
I got it to work by uninstalling it again and installing 1.8.1 instead of 1.9.2. I guess OS X Lion doesn't like the latest release.
Try setting an email address in your git config if you haven't done so already - traced errors and that's what fixed it for me.
git config --global user.email "email#example.com"
Working with a Mac OS X Version 10.7.5 (Lion)
Uninstalling Git latest version (2.2.0) and reinstalling Git version 1.8.4.2 worked for me. Here is the download link for git 1.8.4.2
It says snow-leopard but actually works for Lion here is the page with all git-osx-installer
:o)
I had the same problem, I was using (2.12.2) on Windows 7(x64), I downgraded it to (2.12.1) and now everything is working fine.

OSX Homebrew error: uninitialized constant MACOS

I've searched around a bit and can't seem to find any record of anyone else with this problem.
Whenever I try to run
$ brew update
I am rewarded with
/usr/local/bin/brew:34: uninitialized constant MACOS (NameError)
This isn't my machine and I normally develop on Linux systems so this is all a bit odd to me.
Any help would be greatly appreciated! Please tell me if there is any additional info I should provide. Again, I'm not used to homebrew or OSX.
EDIT
at the request of JameA
xiao:~ patrick$ brew doctor
/usr/local/bin/brew:34: uninitialized constant MACOS (NameError)
xiao:~ patrick$ brew --config
/usr/local/bin/brew:34: uninitialized constant MACOS (NameError)
...Not sure I like this whole "here, use this macbook for the project, it works better" thing...
I'm pretty sure the root cause of this is a failed upgrade attempt to Homebrew 0.9.5 from a much earlier version. Basically, if you run brew update as opposed to sudo brew update a portion of files are updated, while others are not. Here's what worked for me:
Edit /usr/local/bin/brew (it's just a Ruby file, not a compiled binary, so any text editor will do). You'll find a block like:
if MACOS and MACOS_VERSION < 10.5
abort <<-EOABORT.undent
Homebrew requires Leopard or higher. For Tiger support, see:
https://github.com/mistydemeo/tigerbrew
EOABORT
end
Comment this out. Even if you don't know Ruby, you can probably intuit what this is doing—it's checking to see if you have a current version of OSX. Assuming that you do in fact have this version, this sanity check isn't necessary. Brew is still broken, but at least now it will load far enough to give error messages.
Run sudo brew update, spoiler alert: it fails, but this time with a meaningful error message:
$ brew update
error: Your local changes to the following files would be overwritten by merge:
[giant list of files here]
Well, today I learned that brew update is just a wrapper for git pull because anyone who has worked with git knows that error message. We can fix this too.
Switch into the homebrew git repository with cd /usr/local and give the command git reset --hard FETCH_HEAD.
This piece found here.
Give the command sudo brew update. Homebrew should now update successfully and work properly!
Once the system is working again, you can actually kind of see why an error like this would have occurred. For one, usr/local/bin/brew has been completely rewriten and isn't even Ruby anymore, and most of its configuration has been moved into /usr/local/Library/brew.rb which no longer uses the constants MACOS or MACOS_VERSION constants, as they have been replaced by the more object oriented OS.mac and MacOS.version.
The MACOS constant is set in globals.rb. It seems like you may have a borked installation of Homebrew.
Check the output of brew doctor for any suggestions.
If that doesn't help please update with the results of brew --config.
If all else fails you may want to try re-installing Homebrew.
UPDATE:
Since this was a previous user's machine make sure your user is the owner of /usr/local and everything within. Fix it with sudo chown -R $USER /usr/local.
I had a similar issue, when I Killed an install mid-way with Ctrl-D.
Post that whenever I tried installing anything it gave the following error
uninitialized constant Homebrew::CLI::Parser::ARGV_WITHOUT_MONKEY_PATCHING
As a fix, I went to the directory I had where homebrew was installed, and reset the HEAD.
cd /usr/local/Homebrew
git status
git checkout .
And then it started working magically.
I had a similar error with a "borked" installation of brew. I removed the small 5 line block of code in the /usr/local/bin/brew script starting with the MACOS line. That did the trick to allow me to uninstall and eventually reinstall it.
In addition to Matt Korostoff's answer.
On point 3 (resetting the repo), for recent version of Homebrew, the repo is no longer /usr/local, do cd "$(brew --repo)" instead.

Resources