I'm having trouble with brew install <PackageName>
I had macOS BigSur and could use commands like brew easily but in recent downgrade (Mojave) I can't do it anymore
it freeze about 60 second and reply with (If I getting it right) that can't update the main repository
CODE :
Updating Homebrew...
error: Not a valid ref: refs/remotes/origin/master
fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
fatal: Could not resolve HEAD to a revision
==> Homebrew has enabled anonymous aggregate formula and cask analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics
No analytics have been recorded yet (nor will be during this `brew` run).
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
https://github.com/Homebrew/brew#donations
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
==> New Casks
8x8-work disk-expert guilded odbc-manager ubports-installer
diagnostics duplicate-file-finder hush pktriot
==> Updated Casks
Updated 352 casks.
==> Deleted Casks
adafruit-arduino beautune caramba-switcher
adobe-lens-profile-creator blue-jeans-browser-plugin
Warning: No available formula or cask with the name "htop".
==> 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.
Homebrew is managed by git repos. From the output, homebrew is detached and homebrew-core repo is missing.
Let's try following commands to fix the repos.
# Reset remote repo for Homebrew, the pkg manager itself
git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git
# Reset origin for homebrew taps
BREW_TAPS="$(brew tap)"
for tap in core cask{,-fonts,-drivers,-versions}; do
if echo "$BREW_TAPS" | grep -qE "^homebrew/${tap}\$"; then
git -C "$(brew --repo homebrew/${tap})" remote set-url origin https://github.com/Homebrew/homebrew-${tap}.git
fi
done
brew update-reset
If it doesn't work, you may have to reinstall Homebrew.
Related
My MacBook Air was equipped with macOS Mojave Version 10.14.6.
I cannot install wget even if I have checked brew version.
brew --version
The output is :
Homebrew 3.3.13
Homebrew/homebrew-core (no Git repository)
Homebrew/homebrew-cask (git revision fb6ec06d8b; last commit 2022-01-31)
When I tried to install wget:
brew install wget
This is the result:
Warning: No available formula with the name "ca-certificates".
==> 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...
Running `brew update --preinstall`...
Error: No formulae found in taps.
fatal: Could not resolve HEAD to a revision
Warning: No available formula with the name "wget".
==> 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.
This problem has bothered me for a long while...
Eventually, I solved this problem by running the following code:
brew update-reset
brew install wget
I hoped this may help others.
Problem could be 'Homebrew/homebrew-core not tapped properly'. Executing these two commands resolved the issue for me.
rm -rf "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core"
brew tap homebrew/core
trying to install maven using brew install maven
getting bellow error
Running `brew update --preinstall`...
fatal: Could not resolve HEAD to a revision
Warning: No available formula with the name "maven".
==> 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.
Execute the following commands:
brew doctor
git -C $(brew --repo homebrew/core) checkout master
I run the following code, which show that there are no openssl repo find in brew.
My Mac is macOS Big Sur 11.3.1
% brew install openssl
Updating Homebrew...
fatal: Could not resolve HEAD to a revision
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
==> Updated Casks
Updated 1 cask.
Warning: No available formula or cask with the name "openssl".
==> 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...
This formula was found in a tap:
homebrew/portable-ruby/portable-openssl
To install it, run:
brew install homebrew/portable-ruby/portable-openssl
UPDATE
Seems that my brew can't install ccache either like the following. It is more of a brew issue?
brew install ccache
try this put it in terminal and run:
brew uninstall openssl; brew uninstall openssl; brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
The following commands help
cd /usr/local/Homebrew/Library/Taps/homebrew/
rm -rf homebrew-core
git clone https://github.com/Homebrew/homebrew-core.git
try this:
git -C $(brew --repo homebrew/core) checkout master
^This should be the fix anytime you see the error "Could not resolve HEAD to a revision, as you may find at the bottom of the output when running "brew doctor"
brew cask install kdiff3
Error: Cask 'kdiff3' is unavailable: No Cask with this name exists.
brew install kdiff3
Error: No available formula with the name "kdiff3"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
brew search kdiff3
No formula or cask found for "kdiff3".
Closed pull requests:
tap_migrations: remove kdiff3 (https://github.com/Homebrew/homebrew-core/pull/43798)
Delete kdiff3.rb (https://github.com/Homebrew/homebrew-cask/pull/67726)
p4v 18.3-1719707: Add CLI-accessible commands to work with Git out of the box (https://github.com/Homebrew/homebrew-cask/pull/54957)
Update kdiff3 to 0.9.98 (https://github.com/Homebrew/homebrew-cask/pull/31404)
Update kdiff3 - add shimscript (https://github.com/Homebrew/homebrew-cask/pull/35967)
Secure URLs (https://github.com/Homebrew/homebrew-cask/pull/52975)
kdiff3 migrated to cask (https://github.com/Homebrew/homebrew-core/pull/3335)
kdiff3 0.9.98 (https://github.com/Homebrew/legacy-homebrew/pull/31147)
Added formula kdiff3 (https://github.com/Homebrew/legacy-homebrew/pull/5724)
Update kdiff3 to 0.9.97 (https://github.com/Homebrew/legacy-homebrew/pull/14268)
diffpdf: Bump to 2.1.3 (https://github.com/Homebrew/legacy-homebrew/pull/24912)
Doctor: suggest stashing untracked files rather than deleting (https://github.com/Homebrew/legacy-homebrew/pull/15837)
Upgrade kdiff3 to 0.9.98 (https://github.com/Homebrew/homebrew-cask/pull/5231)
Add binary link to kdiff3 (https://github.com/Homebrew/homebrew-cask/pull/3476)
Add kdiff3.app (https://github.com/Homebrew/homebrew-cask/pull/1847)
bugfix: kdiff3 cask name incorrect (https://github.com/Homebrew/homebrew-cask/pull/1990)
Create kdiff3 v0.9.97 cask (https://github.com/Homebrew/homebrew-cask/pull/1292)
New Cask Kdiff3 v0.9.97 (https://github.com/Homebrew/homebrew-cask/pull/1287)
More efficient listing of installed Casks (https://github.com/Homebrew/homebrew-cask/pull/1778)
brew --version
Homebrew 2.1.16
Homebrew/homebrew-core (git revision 2a800; last commit 2019-11-20)
Homebrew/homebrew-cask (git revision 40638; last commit 2019-11-20)
So how to install kdiff3 using brew on mac os?
kdiff3 was removed from Homebrew’s packages in August 2019 because its last compatible version is five years old. If you really want to install it, you can checkout the formula (package) file in the GitHub repo from just before its removal. You can either copy the file locally or directly use the URL:
brew cask install https://raw.githubusercontent.com/Homebrew/homebrew-cask/6a96e5ea44803e52a43c0c89242390f75d1581ab/Casks/kdiff3.rb
Is it possible to install ansible galaxy using brew on mac os? I tried:
$ brew install ansible-galaxy
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 3 taps (homebrew/cask-versions, homebrew/core and homebrew/cask).
==> Updated Formulae
git-lfs ✔ cpprestsdk exercism gobject-introspection kube-aws minio-mc remarshal teleport vegeta
ammonite-repl ddgr fluent-bit grpc libimagequant nailgun root terraform_landscape xsimd
angular-cli dscanner fmt instead librealsense node-build serverless tinyxml2 you-get
arx duo_unix fruit ios-deploy libsass opencv#2 sfcgal tty-solitaire
conan elektra git-quick-stats jdupes libvirt osrm-backend snappystream urdfdom_headers
console_bridge ethereum gitbucket kallisto minio parallelstl sysdig vagrant-completion
Error: No available formula with the name "ansible-galaxy"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
but it didn't work.
Thanks for reading my post.
Once you install ansible on your machine using brew or pip you will get ansible-galaxy automatically it's not a package it's a subcommand of the ansible like ansible-vault ansible-doc etc.