New MacBook Homebrew Install Issue - homebrew

I have a Macbook Pro that has an M1 Chip that is causing issues trying to install Homebrew. I have followed the steps in this article: https://mac.install.guide/homebrew/3.html but when I get to the Homebrew install and I type brew in the terminal I get this
Example usage:
brew search TEXT|/REGEX/
brew info [FORMULA|CASK...]
brew install FORMULA|CASK...
brew update
brew upgrade [FORMULA|CASK...]
brew uninstall FORMULA|CASK...
brew list [FORMULA|CASK...]
Troubleshooting:
brew config
brew doctor
brew install --verbose --debug FORMULA|CASK
Contributing:
brew create URL [--no-fetch]
brew edit [FORMULA|CASK...]
Further help:
brew commands
brew help [COMMAND]
man brew
https://docs.brew.sh
Shouldn't it tell me what version of Homebrew I have and that it's installed?
I am trying to set up my Homebrew so that I can use it with git. I am trying to do brew install git and brew install git-lfs but I get the below error messages when I try to do that.
fatal: Could not resolve HEAD to a revision
Warning: No available formula with the name "git".
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.

Shouldn't it tell me what version of Homebrew I have and that it's installed?
To find the installed version, use the -v option.
% brew -v
Homebrew 3.6.0
Homebrew/homebrew-core (git revision e5722d08e47; last commit 2022-09-09)
Homebrew/homebrew-cask (git revision 0dc06a0f09; last commit 2022-09-09)
fatal: Could not resolve HEAD to a revision
You will need to reinstall, and make sure it uses /opt/homebrew because you are on an M1.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
There shouldn't be any errors displayed when this runs.

Related

Install azure cli via brew not working on mac m1

I am trying to install azure cli on to my mac M1 and getting these issues....
brew install azure-cli
fatal: Could not resolve HEAD to a revision
Warning: No available formula with the name "azure-cli".
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
It was migrated from homebrew/cask to homebrew/core.
I have tried uninstalling and reinstalling brew and upgrading everything that I could find from hours of google searches nothing seems to work for me
After trying many thing things this worked for me...
rm -rf $(brew --repo homebrew/core)
brew tap homebrew/core
For M1 with Monterey, this worked for me:
arch -x86_64 brew update && arch -x86_64 brew install azure-cli

MAC : No available formula with the name "brew-cask"

Trying to install brew-cask after tapping caskroom/cask,
brew tap caskroom/cask
brew install brew-cask
But getting error,
$ brew install brew-cask
Updating Homebrew...
Error: No available formula with the name "brew-cask"
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
This similarly named formula was found:
brew-cask-completion ✔
To install it, run:
brew install brew-cask-completion ✔
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
Tried brew cleanup, untapped caskroom/cask and reinstallation of brew-cask but no luck.
I installed, brew-cask-completion using brew install brew-cask-completion. And read somewhere brew-cask is deprecated. So what is the solution. I ignored it and installed the java open sdk. My question is, is it going to be a problem in future if I don't install it?
Thanks in advance!
It happens because of corrupted core installation, actually you will give this error for installing any packages, you should fix the with:
rm -fr $(brew --repo homebrew/core)
Then install what ever you want, for me:
brew intall deno
Try reinstalling it with these commands in this order:
brew uninstall brew-cask
brew untap caskroom/cask
brew tap caskroom/cask
brew install brew-cask

brew install rbenv Error: rbenv-rbenv already installed To install this version, first `brew unlink rbenv`

I am trying to install rbenv on OS X by following instruction from site link - setup ruby on macbook
when I try brew install rbenv I get below error
Error: rbenv-rbenv already installed To install this version, first 'brew unlink rbenv'
Here is the output from brew doctor
brew doctor
Your system is ready to brew.
I tried brew unlink rbenv on which fails with message Error: No such keg: /usr/local/Cellar/rbenv
Please suggest how this can be solved.
I have tried all solutions as listed below
brew update
brew prune
brew link rbenv
nothing really works
This, I was able to solve by thrashing all the junk files and folders related to rbenv still existing in the system; as brew link rbenv wasn't working
Use command below to find any rbenv files/folder still existing in the system.
sudo find /user/ -name "*rbenv*"
most of the issues could be because /usr/local/opt may still have folders related to rbenv
then carefully remove any listed files/folder using command
sudo rm -r <folder-listed-in-result-of-above-command>
then try brew install rbenv, follow any output from this command (which may suggest brew unlink rbenv && brew link rbenv) and you should be good to go.
I do not recommend file/folder thrashing this way as it could be risky however, to be frank, this is only what worked for me.

Why can't brew find a specific known formula?

I'm trying to install bazel on my mac (10.11.5).
I can see that it is available through brew:
http://braumeister.org/formula/bazel
But when I run "brew install bazel", I get this:
Error: No available formula for bazel
Searching formulae...
Searching taps...
Why is this?
In my case, Homebrew was already up-to-date after running brew update and I still received the same error messages as the OP when trying to install xdebug:
$ brew update
Already up-to-date.
$ brew install php70-xdebug
Error: No available formula with the name "php70-xdebug"
Using Mark's suggestion from the comments on OP solved the problem:
$ brew search xdebug
homebrew/php/xdebug-osx homebrew/php/php70-xdebug
So now, running $ brew install homebrew/php/php70-xdebug, Homebrew found and installed the package.
You should update your brews, because it is indeed available. Run
brew update
brew install bazel
and then it should work.

How to uninstall Homebrew Cask

I installed Homebrew Cask for kicks as described at http://caskroom.io/. It boils down to the following command:
$ brew install caskroom/cask/brew-cask
$ brew tap caskroom/versions
Homebrew Cask installed and everything was fine. Then I uninstalled Homebrew Cask like so:
$ brew untap caskroom/versions
$ brew uninstall brew-cask
Here are the current taps:
$ brew tap
homebrew/versions
Yet I see stuff from Cask when searching for items that wouldn't be part of Homebrew itself (like Graphical programs, aText, Fantastical etc.):
$ brew search atext
Caskroom/cask/atext
Though it doesn't install (as expected):
$ brew install atext
Error: No available formula for atext
Searching formulae...
Searching taps...
Caskroom/cask/atext
So the question is why does brew search Caskroom/cask and how do I get rid of it (I don't want Homebrew telling me it has aText, for example, when it can't install it)?
I am running Mac OS X Yosemite.
For the current version of Brew:
$ brew uninstall --cask yed
For older versions of Brew:
$ brew cask uninstall yed
the result:
==> Removing App symlink: '/Users/user/Applications/yEd.app'
As of Homebrew version 0.9.5, it appears that brew search will find items in Caskroom/cask/ without actually having Homebrew Cask installed. You can also install them, but this will actually install brew-cask as a dependency along the way.
Try:
brew install Caskroom/cask/atext
Command the terminal to "untap" at the prompt [MacOS Catalina 10.15.2]
Run
brew untap homebrew/cask-fonts
Expected output
Untapping homebrew/cask-fonts...
Untapped 1571 casks (1,713 files, 11.4MB)

Resources