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

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?

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

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.

Can't install cocoapods on macOS Big Sur

I am using MacOS Big Sur 11.0 Beta.
I tried to install cocoapods but I can't.
First, I tried with;
sudo gem install cocoapods
It says
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
Then, I tried with;
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew cleanup -d -v
brew install cocoapods --build-from-source (also tried with "brew install cocoapods")
It says
Error: pkg-config: no bottle available!
You can try to install from source with:
brew install --build-from-source pkg-config
So, I tried brew install --build-from-source pkg-config, and it says Error: macOS '10.16' is invalid.
Anybody can help me?

Unistall error using home-brew -> error using brew prune

I have Paste installed and want to uninstall it, currently running macOS High Sierra.
I have tried using the $ brew uninstall Paste and it gets returned with Error: No such keg: /usr/local/Cellar/paste.
After that I used $ brew update of which everything is up-to-date.
So after that I used $ brew doctor which returned
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: Broken symlinks were found. Remove them with `brew prune`:
/usr/local/share/ghostscript/9.16/Resource/CIDFont/HiraKakuPro-W3
/usr/local/share/ghostscript/9.16/Resource/CIDFont/HiraKakuPro-W6
/usr/local/share/ghostscript/9.16/Resource/CIDFont/HiraKakuProN-W3
/usr/local/share/ghostscript/9.16/Resource/CIDFont/HiraKakuProN-W6
/usr/local/share/ghostscript/9.16/Resource/CIDFont/HiraKakuStd-W8
/usr/local/share/ghostscript/9.16/Resource/CIDFont/HiraKakuStdN-W8
/usr/local/share/ghostscript/9.16/Resource/CIDFont/HiraMaruPro-W4
/usr/local/share/ghostscript/9.16/Resource/CIDFont/HiraMaruProN-W4
/usr/local/share/ghostscript/9.16/Resource/CIDFont/HiraMinPro-W3
/usr/local/share/ghostscript/9.16/Resource/CIDFont/HiraMinPro-W6
/usr/local/share/ghostscript/9.16/Resource/CIDFont/HiraMinProN-W3
/usr/local/share/ghostscript/9.16/Resource/CIDFont/HiraMinProN-W6
/usr/local/share/ghostscript/9.16/Resource/CIDFont/HiraginoSansGB-W3
/usr/local/share/ghostscript/9.16/Resource/CIDFont/HiraginoSansGB-W6
/usr/local/share/ghostscript/9.16/Resource/CIDFont/YuGo-Bold
/usr/local/share/ghostscript/9.16/Resource/CIDFont/YuGo-Medium
/usr/local/share/ghostscript/9.16/Resource/CIDFont/YuMin-Demibold
/usr/local/share/ghostscript/9.16/Resource/CIDFont/YuMin-Medium
However, when I try and use $ brew prune I get returned with
Error: Permission denied # unlink_internal - /usr/local/share/ghostscript/9.16/Resource/CIDFont/HiraKakuPro-W3
Can anyone help with this issue?
Simply run:
brew uninstall paste
You're getting the error: No such keg: /usr/local/Cellar/pastewhenbrew uninstall Past because there are no brew formulae installed or in the official Homebrew repository named paste.
brew install paste
Error: No available formula with the name "paste"
I guess you've installed it using cask:
brew cask install paste
If you try to uninstall it using brew you'll get that error:
brew uninstall Paste
Error: No such keg: /usr/local/Cellar/paste
To uninstall paste simply use brew cask instead:
brew cask uninstall paste

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