Install azure cli via brew not working on mac m1 - homebrew

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

Related

Error: /usr/local/Cellar/xz/5.2.4 is not a valid keg

I wanted to install package gdal on my Mac. I ran arch -x86_64 brew install gdal. However, it returned this error:
Error: /usr/local/Cellar/xz/5.2.4 is not a valid keg
You need to run brew update before the gdal installation, the latest xz is 5.4.1.
If still does not work, can you also update the OP and include brew config and brew doctor outputs?

New MacBook Homebrew Install Issue

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.

Flutter Doctor CocoaPods not installed

When I run Flutter doctor:
I have tried to run sudo gem install cocoapods to install it but still the same issue.
Please not that I am running xcode 12 with the newest flutter version in the dev channel.
Any ideas?
Error after running the flutter build:
What worked for me was to uninstall Cocoapods using sudo gem uninstall cocoapods and using Homebrew instead brew install cocoapods. P.s. I'm using an M1 Macbook.
I had the same problem and after hours of looking for a solution, I solved it with these steps:
(prerequisites: install homebrew first. To check if installed, in your terminal, type $ brew -v )
$ sudo gem uninstall cocoapods (skip this part if cocoapods is not installed. command $pod --version , will tell you if it's installed or not)
$ brew install cocoapods
If there's an error 'The brew link step did not complete successfully
The formula built,........, command $ brew link --overwrite cocoapods
$ brew reinstall cocoapods
$ flutter run
My operating system is macOS Big Sur.
Are you getting an error when you tried to sudo gem install cocoapods? I had to do sudo gem install ruby first to make it work on my Mac.
In my case the problem was that there was no ruby installation on my mac after a clean install of MacOSX Catalina. So what I did, was first to install Ruby Version Manager with this command:
\curl -sSL https://get.rvm.io | bash -s stable --rails
The RVM installed Ruby on my system along with other dependencies. After that I was able to install cocoapods with the recommended command:
sudo gem install cocoapods
and it worked flawlessly for me after that. Hope this helps. It seems that Apple has removed many developer tools lately from its systems, Ruby being one of them :(

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

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.

Resources