Homebrew Mac Update Issues - macos

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

Related

How to start over with Homebrew?

I recently replaced my Intel Macbook with an M2 Mac, using my Time Machine backup to initialize the hard drive. That, of course, dutifully copied all the Intel code.
I had brewed onto the old system. Today running brew upgrade gives me:
Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)!
Please create a new installation in /opt/homebrew using one of the
"Alternative Installs" from:
https://docs.brew.sh/Installation
You can migrate your previously installed formula list with:
brew bundle dump
So of course I ran brew bundle dump and that didn't give me any more direction. I'm ready to wipe the entire slate clean with something like rm -rf xxx and start over, but I feel like I should be choosy about xxx.
FWIW, brew --version returns:
Homebrew 3.6.5-10-gbde685a
Homebrew/homebrew-core (git revision d6fa8906828; last commit 2022-10-11
Homebrew/homebrew-cask (git revision 576798b72f; last commit 2022-10-12)
Any real help would be welcome (except "switch to macports").
It turns out that just running "brew bundle dump" is only the first step. Follow that wit "brew bundle install --file Brewfile", as explained very clearly in earthly.dev/blog/homebrew-on-m1
Don't rush to follow my advice, or accept my answer. Someone else may give you something better if you are patient...
You should be able to get a list of installed packages in the current setup then it'll be easier to install the same packages in the new one. Try this and see if it looks correct:
brew ls > ~/oldbrewpackages.txt
You need to find where your current casks and stuff are installed. Like this:
brew config
and look for HOMEBREW_PREFIX. Snuffle around in there and see if it looks like where all your packages are.
Next, I would look around for anything to do with homebrew in my login profiles, comment it out by putting a hash (#) at the start of the line, save the file and check you can still start a new Terminal without errors:
grep -i homebrew -/.*
Now, rather than removing all your homebrew stuff under HOMEBREW_PREFIX, I would try renaming it. You may need to turn off "System Integrity Protection" first.
Then if your homebrew stuff is under /opt/homebrew, you could do:
sudo mv /opt/homebrew /opt/homebrew.unused
Then you'll want to reboot.
Now you should be able to install a new homebrew without it detecting the old one... hopefully.
To install your previous packages in your new homebrew, you want:
brew install $(cat -/oldbrewpackages.txt)
If everything looks good and works well, make a backup and then type the command to delete your old stuff, and read it very carefully 3x before hitting Enter
sudo rm -rf /opt/homebrew.unused

Mac command line tools 11.4 no longer has svn

I just updated XCode and the command line tools to 11.4. Now when I run svn it says "svn: error: The subversion command line tools are no longer provided by Xcode". The release notes say "Command line tool support for Subversion — including svn, git-svn, and related commands is no longer provided by Xcode. If you need Subversion or related command line tools the you need to install the Command Line Tools package by running xcode-select --install." I seem to be in a loop here, as the tools are installed. Has anyone experienced this problem and resolved it?
macOS Catalina
I had the same issue after upgrading to Catalina 10.15. It's clearly mentioned in the Apple website that SVN is deprecated in Xcode 11:
You can find it here: https://developer.apple.com/documentation/macos_release_notes/macos_catalina_10_15_release_notes
Command line tool support for Subversion — including svn, git-svn, and related commands — is no longer provided by Xcode.
The solution is to install the standalone Command Line Tools package instead:
sudo rm -rf /Library/Developer/CommandLineTools
followed by:
sudo xcode-select --install
This will replace the bundled Command Line Tools with the standalone package.
If it doesn't work for you then try to install it with brew.
brew install svn
brew is a package manager for MacOS so if you don't have it installed then you can simply install it: https://brew.sh/
macOS Big Sur
I faced the same issue Today (16th November 2020) after upgrading to MacOS Big Sur. I was able to fix it by installing the SVN again using brew install svn command.
If you faced permission errors after running above command, you can fix it by running following command.
sudo chown -R $(whoami) /usr/local/*
brew install svn
in Xcode 11.4. Svn has been removed.
I had same issue from Netbeans and have done the following from command line and now all fine
sudo xcode-select --install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install svn
Coming from a FreeBSD background we elected to install SVN via MacPorts which is akin to FreeBSD Ports. So basically one would first need to install MacPorts and then install SVN as follows:
sudo port install subversion
Some details -
Install MacPorts: https://www.macports.org/install.php
Install SVN: https://trac.macports.org/wiki/howto/Subversion
It took less than five(5) minutes and works well for us.
I switched to SVNKIT which works very well for my purposes. Since I'm doing a lot of Java development is no drawback for me that SVNKIT is based on Java.
The big advantage is that SVNKIT will still work even if Apple throws SVN out completely.
I found svn still available on my Mac (upgraded from 10.15.x -> Big Sur, including XCode upgrade) in
/Library/Developer/CommandLineTools/usr/bin/svn
In the Apple Developers forum I read the suggestion to make an alias, which worked for me. However, considering svn is being dropped by Apple, this will probably not work on new installs, but it could be useful for those of us that just want it to work for now after upgrading.
alias svn=/Library/Developer/CommandLineTools/usr/bin/svn
Note: I found it easier to just make a symbolic link to svn:
ln -s /Library/Developer/CommandLineTools/usr/bin/svn /usr/local/bin/svn
my mac os version is macOs Catalina 10.15.5,I try
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
brew install svn
but it not work.so I try to install with source code.It's work!
tar xvf subversion-1.14.0.tar.gz
cd subversion-1.14.0
./configure --with-apr=/usr/local/opt/apr --with-apr-util=/usr/local/opt/apr-util
make
now,you can find it in /usr/local/bin/
Based partly on the other answers here, I built from source with this procedure:
Download & unpack svn source tarball (NOT zip file!) from
https://subversion.apache.org/download.cgi
cd subversion-1.14.0
./get-deps (this seems to have downloaded apr and apr-util but not
built them)
cd apr
sudo mkdir /usr/local/opt
(because I did not already have such a directory on a fresh Mac)
./configure --prefix=/usr/local/opt/apr
make
make test
(saw lots of "OK" and "SUCCESS", plus one failure in "testsock")
sudo make install
cd ../apr-util
./configure --prefix=/usr/local/opt/apr-util --with-apr=/usr/local/opt/apr
cd ..
make
./configure --with-apr=/usr/local/opt/apr --with-apr-util=/usr/local/opt/apr-util --with-lz4=internal --with-utf8proc=internal
make
sudo make install
The top instructions (removing the command line tools, xcode-select --install, and brew install svn) worked for me (Monterey, 12.5.1, on an M1 pro). Thanks!
However, after I did the brew install, I had to manually remove the old svn version from /opt/local/bin before the new version would run. (discovered with $ which svn). Might be the result of migrating from the old laptop to the new one.

How to get back Homebrew to previous state?

I deleted some of .rb files(cassandra.rb,cassandra#2.1.rb and cassandra#2.2.rb) from folder /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ from mac system.I want back those .rb files.I thought brew upgrade will give me back those deleted .rb files back.But they are still missing. Those .rb files are important for me to install packages.
brew install cassandra gives
Updating Homebrew...
Error: No available formula with the name "cassandra"
==> Searching for a previously deleted formula...
cassandra was deleted from homebrew/core in commit d20fe73:
cassandra: update 3.10_1 bottle.
To show the formula before removal run:
git -C "$(brew --repo homebrew/core)" show d20fe73^:Formula/cassandra.rb
If you still use this formula consider creating your own tap:
http://docs.brew.sh/How-to-Create-and-Maintain-a-Tap.html
Please I need solution "how to get back these .rb files?" or "any other alternative way to install cassandra".
Install directly from GitHub as mentioned here -
How to restore brew formula after I rm it
brew install https://github.com/Homebrew/homebrew-core/tree/master/Formula/cassandra.rb
Try this command to bring back all of deleted files.
Note: This command will revert all change in $(brew --repo homebrew/core)
cd $(brew --repo homebrew/core) && git reset --hard origin/master
Homebrew uses git internally, so use git commands to repair some problem.

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

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.

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