5

Not too familiar with homebrew. I'm trying to downgrade jq from 1.6 to 1.3.1 by running

brew install jq@1.3.1

but I keep receiving

Warning: No available formula with the name "jq@1.3.1".
==> 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.

as my error response.

I've tried brew install jq@1.3, brew install jq=1.3, brew install jq==1.3 to no avail. Any advice?

oguz ismail
  • 1
  • 16
  • 47
  • 69
  • Does this answer your question? [homebrew - how to install older versions](https://stackoverflow.com/questions/39187812/homebrew-how-to-install-older-versions) – matt May 03 '22 at 22:08

1 Answers1

9

jq 1.3 is available via homebrew, but AFAICT, a version specifically tagged 1.3.1 is not. (See e.g. https://stedolan.github.io/jq/download )

One way to fetch a specific version is as follows:

  1. First you'll probably want to uninstall jq:
brew uninstall jq
  1. Find a suitable jq.rb e.g. by browsing https://github.com/Homebrew/homebrew-core/commits/master/Formula/jq.rb

For jq 1.3 the following would suffice:

URL=https://github.com/Homebrew/homebrew-core/blob/9517da4a73f8eb9af8c8c217a52526f5edf428a2/Formula/jq.rb
  1. Fetch and execute the script
wget $URL  # or use curl

brew install -s jq.rb
peak
  • 105,803
  • 17
  • 152
  • 177
  • 7
    really? this is how you do it? they had `brew versions` and `brew switch` before and now i have to read some ruby to install an older version of a package? – Cpt. Senkfuss Nov 08 '22 at 09:28
  • Maybe it's worth to add that the name of the file should match exactly the formula one. So, for example: for `jq` formula it will be `jq.rb`, for `skaffold` it will be `skaffold.rb`, etc. – Marco Rapaccini Nov 17 '22 at 14:55