Why can't brew find a specific known formula? - homebrew

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.

Related

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.

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

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

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.

How do I update a formula with Homebrew?

How do I update a formula?
I ran brew update. However, mongodb is still outdated according to brew outdated:
mongodb (1.4.3-x86_64 < 1.6.5-x86_64)
First, update brew's internal list of formulae to the latest:
brew update
To upgrade only the mongodb formula, use install:
brew install mongodb
To upgrade all outdated formulae:
brew upgrade
You can update all outdated packages like so:
brew install `brew outdated`
or
brew outdated | xargs brew install
or
brew upgrade
This is from the brew site..
for upgrading individual formula:
brew install formula-name && brew cleanup formula-name
You will first need to update the local formulas by doing
brew update
and then upgrade the package by doing
brew upgrade formula-name
An example would be if i wanted to upgrade mongodb, i would do something like this, assuming mongodb was already installed :
brew update && brew upgrade mongodb && brew cleanup mongodb
Well, I just did
brew install mongodb
and followed the instructions that were output to the STDOUT after it finished installing, and that seems to have worked just fine. I guess it kinda works just like make install and overwrites (upgrades) a previous install.
You can't use brew install to upgrade an installed formula. If you want upgrade all of outdated formulas, you can use the command below.
brew outdated | xargs brew upgrade
I prefer to upgrade all homebrew formulae and homebrew cask formulae.
I added a Bourne shell function to my environment for this one (I load a .bashrc)
function updatebrew() {
set -x;
brew update;
brew cleanup;
brew cask upgrade --greedy
)
}
set -x for transparency: So that the terminal outputs whatever Homebrew is doing in the background.
brew update to update homebrew formulas
brew cleanup to remove any change left over after installations
brew cask upgrade --greedy will install all casks; both those with versioning information and those without

Resources