I'm just about to finally update my MacBook Pro to macOS Mojave, hoping that the issues have all been resolved. But when I got this new machine I changed from using MacPorts to using Homebrew.

When I used MacPorts, I had a (semi-successful) recipe for handling an OS upgrade: save a list of the ports, remove the MacPorts installation, install the new OS, install the new developer tools, install MacPorts, and then slog through the saved port list and update (since inevitably the set of ports would have changed).

What's the corresponding recipe for Homebrew? I have searched for "brew update Mojave" and found nothing.

  • 7
    Why don't you just run brew update; brew upgrade, without removing anything before doing the macOS upgrade? I never did anything special for Homebrew when upgrading the OS. – nohillside May 10 '19 at 16:16

Homebrew manages all updating/upgrading by itself. Run brew update && brew upgrade every once in a while (and you can do it after upgrading macOS). brew update will update the list of available formulae, and brew upgrade will upgrade any outdated packages.

If you like, everything can be scripted as well:

  1. Run the macOS installer: startosinstall
  2. Run all macOS updates for Xcode, etc..: softwareupdate -ai
  3. Update homebrew itself and the package lists: brew update
  4. Upgrade all software installed with homebrew: brew upgrade

You don't need to remove/uninstall anything before upgrading macOS. Just download the macOS installer from the App Store (or from System Preferences), and follow the instructions to install the new OS like normal.

  • 2
    I'll edit how I do this to explicitly mention upgrading Xcode / command line tools. Home-brew will complain when it detects this, but I think it helps people plan. – bmike May 11 '19 at 12:53
  • @abc, it will be useful to add a fifth step - brew cleanup to remove old versions of installed formulae, for space saving. – Yoan May 11 '19 at 14:12
  • 1
    You should also run brew cask upgrade after upgrading macOS to update any desktop applications you've installed with Cask. – user332275 May 13 '19 at 17:53
  • 1
    Lately, Warning: Calling brew cask upgrade is deprecated! Use brew upgrade --cask instead. appears, so step 5 should be updated with the new syntax :) – Ahi Tuna Sep 18 '20 at 12:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .