Unknown or unsupported macOS version: :mountain_lion

I run “brew doctor”, I shows an error “unknown or unsupported macOS version: :mountain_lion”, I don`t know how to fix it.
The whole log I paste down below:
*********(there is a lot of Warnings)
Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn’t put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
/usr/local/lib/pkgconfig/librtlsdr.pc
/usr/local/lib/pkgconfig/libxml-2.0.pc
/usr/local/lib/pkgconfig/opencv.pc
/usr/local/lib/pkgconfig/tcl.pc
/usr/local/lib/pkgconfig/tk.pc

Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn’t put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected static libraries:
/usr/local/lib/libdicom2meshlib.a
/usr/local/lib/libopencv_ts.a
/usr/local/lib/librtlsdr.a
/usr/local/lib/libtclstub8.6.a
/usr/local/lib/libtkstub8.6.a
/usr/local/lib/libvtkDICOM-8.2.0.a
/usr/local/lib/libvtkDICOMPython37D-8.2.0.a
/usr/local/lib/libxml2.a
Error: unknown or unsupported macOS version: :mountain_lion

Homebrew support for Mountain Lion and earlier macOS versions was removed in Jan 2019. At this point, if you want to continue using Homebrew, you’d need to upgrade to at least Mavericks (which Apple themselves stopped supporting almost 4 years ago).

I am on macOS Catalina 10.15.5, and brew doctor ends with:

Error: unknown or unsupported macOS version: :mountain_lion
$ brew --version
Homebrew 2.4.0
Homebrew/homebrew-core (git revision e65da; last commit 2020-06-18)
3 Likes

Do you have any formula pinned? And what is the rest of the output of brew doctor

I have the same issue, but I am running on Catalina :thinking::

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: Some installed formulae were deleted!
You should find replacements for the following formulae:
  mongodb
  sshpass

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  mongodb-community
  ansible
  git
Error: unknown or unsupported macOS version: :mountain_lion
~ > sw_vers
ProductName:	Mac OS X
ProductVersion:	10.15.4
BuildVersion:	19E287
1 Like

I suspect it’s one of the deleted formula then. Those can’t be kept up to date and might therefore break

1 Like

I am having the same issue and error.

Same OS and version - 10.15.5.

Homebrew 2.4.0
Homebrew/homebrew-core (git revision 956ef; last commit 2020-06-19)

Fixed after following @SMillerDev and removed packages referencing deleted formula. Thanks!

Noob question: can someone point out which formulas I should (or can safely) remove based on these warnings? I am running Mojave. Thanks!

Warning: Some installed formulae were deleted!
You should find replacements for the following formulae:
  xdebug-osx
  node@6
  python@2
  mongodb

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
  /usr/local/include/node/android-ifaddrs.h
  /usr/local/include/node/ares.h
  /usr/local/include/node/ares_build.h
  /usr/local/include/node/ares_rules.h
  /usr/local/include/node/ares_version.h
  /usr/local/include/node/nameser.h
  /usr/local/include/node/pthread-barrier.h
  /usr/local/include/node/stdint-msvc2008.h
  /usr/local/include/node/tree.h
  /usr/local/include/node/uv-aix.h
  /usr/local/include/node/uv-bsd.h
  /usr/local/include/node/uv-darwin.h
  /usr/local/include/node/uv-errno.h
  /usr/local/include/node/uv-linux.h
  /usr/local/include/node/uv-os390.h
  /usr/local/include/node/uv-posix.h
  /usr/local/include/node/uv-sunos.h
  /usr/local/include/node/uv-threadpool.h
  /usr/local/include/node/uv-unix.h
  /usr/local/include/node/uv-version.h
  /usr/local/include/node/uv-win.h
  /usr/local/include/node/v8-debug.h
  /usr/local/include/node/v8-experimental.h

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  python
  gettext
Error: unknown or unsupported macOS version: :mountain_lion

All of these are very outdated software and should be removed.

1 Like

And in the specific case of mongodb, the MongoDB folks now maintain their own official tap. See https://github.com/mongodb/homebrew-brew for details on how to use it.

2 Likes

Thanks @SMillerDev & @gromgit! Is it enough to just uninstall xdebug-osx, etc. ?

I believe it will be, but it’s hard to determine the state of your install through a forum. Best way is to try

1 Like

removing mongodb fixed this error for me. (also actually on Catalina)

(EDIT: my problem is fixed, I’m listing my fix in case it helps others).
Such an error blocked brew cask uninstall mplayer-osx-extended:

$ brew cask uninstall --force mplayer-osx-extended
Error: Cask 'mplayer-osx-extended' definition is invalid: invalid 'depends_on macos' value: ">= :lion"

The problem wasn’t in the current mplayer-osx-extended cask, but in the old version I had installed time ago.

After a while, I fixed this by modifying /usr/local/Caskroom/mplayer-osx-extended/.metadata/rev16/20180512214514.676/Casks/mplayer-osx-extended.rb. Uninstall still failed, but at least I could fix that by removing files by hand (which needed sudo).

$ brew cask uninstall mplayer-osx-extended
==> Uninstalling Cask mplayer-osx-extended
==> Backing App 'MPlayer OSX Extended.app' up to '/usr/local/Caskroom/mplayer-osx-extended/rev16/MPlayer OSX Extended.app'.
==> Removing App '/Applications/MPlayer OSX Extended.app'.
Error: Directory not empty @ dir_s_rmdir - /Applications/MPlayer OSX Extended.app
Follow the instructions here:
  https://github.com/Homebrew/homebrew-cask#reporting-bugs

Same error with me.

$ 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: Some installed formulae were deleted!
You should find replacements for the following formulae:
  qt@5.7
  isl@0.12
Error: unknown or unsupported macOS version: :mountain_lion

Remove installed formulae works for me:

➜ Taps$ git:(master)
$ mv /usr/local/Cellar/qt@5.7       ~/tmp
➜ Taps$ git:(master)
$ mv /usr/local/Cellar/isl@0.12        ~/tmp