Brew thinks I'm on Mountain Lion but I'm not

Hello!

My “sw_vers” shows the following info:
“ProductName: Mac OS X
ProductVersion: 10.14.6
BuildVersion: 18G1012”

But when I run “brew missing” or “brew doctor” I get the following messages:

brew missing:
“Error: unknown or unsupported macOS version: :mountain_lion”

brew doctor:
“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: “config” scripts exist outside your system or Homebrew directories. ./configure scripts often look for *-config scripts to determine if software packages are installed, and which additional flags to use when compiling and linking.

Having additional scripts in your path can confuse software installed via Homebrew if the config script overrides a system or Homebrew-provided script of the same name. We found the following “config” scripts:
/opt/local/bin/pkg-config
/opt/local/bin/MagickCore-config
/opt/local/bin/MagickWand-config
/opt/local/bin/icu-config
/opt/local/bin/freetype-config
/opt/local/bin/libpng16-config
/opt/local/bin/Magick+±config
/opt/local/bin/libpng-config
/opt/local/bin/xml2-config
/opt/local/bin/ncursesw6-config
/opt/local/bin/Wand-config
/opt/local/bin/Magick-config
/opt/local/bin/uuid-config
/opt/local/bin/pcre-config
/opt/local/bin/ncurses6-config
/opt/local/bin/python3.8-config
/opt/ImageMagick/bin/MagickCore-config
/opt/ImageMagick/bin/MagickWand-config
/opt/ImageMagick/bin/Magick+±config
/opt/ImageMagick/bin/Wand-config
/opt/ImageMagick/bin/Magick-config
Error: unknown or unsupported macOS version: :mountain_lion”

What does this mean and what can I do to fix it?

As a side note, I’m wondering if it’s also the reason why I can’t install ImageMagick. I get the following error message for that even when I use --build-from-source … “Error: imagemagick: Unsupported special dependency :perl”

Thank you for any help!

Hi Chris,

Homebrew doesn’t think you’re on Mountain Lion. It’s complaining about a formula or cask that depends on Mountain Lion while it’s not supposed to.

Firstly, let’s check whether you have any such candidates installed. Please run the following from your Terminal and post the output in a reply to this comment.

grep -R --include='*.rb' :mountain_lion "$(brew --cellar)"

Kind regards and greetings from Darmstadt, Germany
Claudia

Thank you Claudia!

Here is my output after running the message you provided above.

/usr/local/Cellar/ffmpeg/3.4/.brew/ffmpeg.rb: args << “–enable-videotoolbox” if MacOS.version >= :mountain_lion
/usr/local/Cellar/qt/5.9.3/.brew/qt.rb: depends_on :macos => :mountain_lion
/usr/local/Cellar/curl/7.56.1/.brew/curl.rb: if MacOS.version < :mountain_lion || build.with?(“nghttp2”)
/usr/local/Cellar/curl/7.56.1/.brew/curl.rb: if MacOS.version < :mountain_lion || build.with?(“openssl”) || build.with?(“nghttp2”)
/usr/local/Cellar/gettext/0.19.8.1/.brew/gettext.rb: depends_on “libxml2” if MacOS.version <= :mountain_lion

What does brew config say?

Hi Sean,

brew config gave me the following:

HOMEBREW_VERSION: 2.4.9

ORIGIN: https://github.com/Homebrew/brew

HEAD: e6b066a3d9fc5435009428fcd2855fddf9b455c0

Last commit: 35 hours ago

Core tap ORIGIN: https://github.com/Homebrew/homebrew-core

Core tap HEAD: fc480fcce726cfbeec342b1323a71f89c2cec4ba

Core tap last commit: 2 years, 8 months ago

HOMEBREW_PREFIX: /usr/local

HOMEBREW_MAKE_JOBS: 8

CPU: octa-core 64-bit ivybridge

Homebrew Ruby: 2.6.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/bin/ruby

Clang: 10.0 build 1001

Git: 2.20.1 => /Library/Developer/CommandLineTools/usr/bin/git

Curl: 7.54.0 => /usr/bin/curl

macOS: 10.14.6-x86_64

CLT: 10.3.0.0.1.1562985497

Xcode: 11.3.1

The issue is in qt.

Open the file /usr/local/Cellar/qt/5.9.3/.brew/qt.rb in a text editor and remove the line that says:

depends_on :macos => :mountain_lion

Then save the modified file. Now the issue should be gone.

1 Like

There is about a hunderd commits to homebrew/core every day. You’re very far behind. You should really run brew update to get the latest or brew update-reset if that doesn’t change anything and then run some brew upgrade to make sure you have all the security issues from the last 2,5 years patched.

2 Likes

Hi Claudia, thanks for suggesting this.

I edited the right file you suggested using Brackets and double-checked the change went through using Xcode, then reset my Mac but the same error message shows when running brew doctor “Error: unknown or unsupported macOS version: :mountain_lion”

Not sure what is wrong with it!

Hi Sean, thanks for this!

I ran brew update-reset and then brew upgrade but it doesn’t seem to have changed anything. Not sure why my Brew is struggling.

Here’s the output I got.

brew update-reset:

“ remote: Enumerating objects: 22, done.

remote: Counting objects: 100% (22/22), done.

remote: Total 28 (delta 22), reused 22 (delta 22), pack-reused 6

Unpacking objects: 100% (28/28), done.

From https://github.com/Homebrew/brew

8de682a0b…2b33f995f master -> origin/master

==> Resetting /usr/local/Homebrew…

Branch ‘master’ set up to track remote branch ‘master’ from ‘origin’.

Switched to and reset branch ‘master’

Your branch is up to date with ‘origin/master’.

==> Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core…

error: RPC failed; curl 18 transfer closed with outstanding read data remaining

fatal: the remote end hung up unexpectedly

fatal: protocol error: bad pack header

==> Resetting /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core…

Branch ‘master’ set up to track remote branch ‘master’ from ‘origin’.

Reset branch ‘master’

Your branch is up to date with ‘origin/master’.”

//

And here’s the output I got for brew upgrade:

“ Updating Homebrew…

==> No Casks to upgrade

//

Finally, here’s the output I got for brew config after I’d ran those other two commands:

“ HOMEBREW_VERSION: 2.4.9-61-g2b33f99

ORIGIN: New users can only put 2 links in

HEAD: 2b33f995f371d0a4dc534c8f800954e6a8425b28

Last commit: 7 hours ago

Core tap ORIGIN: New users can only put 2 links in

Core tap HEAD: fc480fcce726cfbeec342b1323a71f89c2cec4ba

Core tap last commit: 2 years, 8 months ago

HOMEBREW_PREFIX: /usr/local

HOMEBREW_MAKE_JOBS: 8

CPU: octa-core 64-bit ivybridge

Homebrew Ruby: 2.6.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/bin/ruby

Clang: 10.0 build 1001

Git: 2.20.1 => /Library/Developer/CommandLineTools/usr/bin/git

Curl: 7.54.0 => /usr/bin/curl

macOS: 10.14.6-x86_64

CLT: 10.3.0.0.1.1562985497

Xcode: 11.3.1”

Brew doctor still shows issue with “Error: unknown or unsupported macOS version: :mountain_lion” too.

Looks like Git is having trouble fetch homebrew/core. Please run the following command, and show us the output:

git -C $(brew --repo homebrew/core) fetch --force --tags origin

If that throws the same error as above, show us the output of git -C $(brew --repo homebrew/core) config -l. Otherwise, run brew update-reset and brew missing again and watch out for any further errors.

1 Like

Hi Adrian (everyone is very helpful here - thank you everyone for taking the time to help me!)

Here is all the output I got for the recommendations you provided:

git -C $(brew --repo homebrew/core) fetch --force --tags origin
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: the remote end hung up unexpectedly
fatal: protocol error: bad pack header`
git -C $(brew --repo homebrew/core) config -l
credential.helper=osxkeychain
http.postbuffer=524288000
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
core.autocrlf=false
remote.origin.url=https://github.com/Homebrew/homebrew-core
remote.origin.fetch=+refs/heads/master:refs/remotes/origin/master
branch.master.remote=origin
branch.master.merge=refs/heads/master
homebrew.private=false
brew update-reset
==> **Fetching /usr/local/Homebrew...**

==> **Resetting /usr/local/Homebrew...**

Branch 'master' set up to track remote branch 'master' from 'origin'.

Reset branch 'master'

Your branch is up to date with 'origin/master'.

==> **Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...**

error: RPC failed; curl 18 transfer closed with outstanding read data remaining

fatal: the remote end hung up unexpectedly

fatal: protocol error: bad pack header

==> **Resetting /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...**

Branch 'master' set up to track remote branch 'master' from 'origin'.

Reset branch 'master'

Your branch is up to date with 'origin/master'.
brew missing
Error: unknown or unsupported macOS version: :mountain_lion

I’m seeing these keywords “curl”, “bad pack header”, and “mountan_lion” associated with some of these errors. I don’t know what these mean though or if they have significance to the overall issue which appears to be a bit deeper than I first realised.

OK, it’s now pretty clear that at least one network device between you and GitHub doesn’t like big downloads. You should talk to the folks around you to see if they have the same issue, and possible ways to deal with it. In particular, a web proxy may be the solution to your problem…or the cause.

As a special case, if you’re in China, see this thread for details on a local mirror that may help: Install problem in China

Regardless, this is a network issue that can only be solved from your end. Once you can get a brew update to complete without any errors, your original problem should resolve itself.

1 Like

Thank you, Adrian! I’ve just put GitHub.com on my whitelist internet settings and brew update and brew upgrade have installed!

Can confirm it’s all working 100%. Thanks so much everyone for the help!

1 Like