The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

macos – How can I update everything installed through Homebrew after OSX upgrade? – Ask Different

Posted by jpluimers on 2025/02/13

[Wayback/Archive] macos – How can I update everything installed through Homebrew after OSX upgrade? – Ask Different

A

Use the command brew upgrade in the terminal to update all of the packages.

C

brew upgrade --cask not updated my excited packages like Flutter. using brew upgrade --g will be preferred as mentioned in Manpage : –g–greedyAlso include outdated casks with auto_updates true or version :latest. –greedy-latestAlso include outdated casks including those with version :latest. –greedy-auto-updatesAlso include outdated casks including those with auto_updates true.

C

Casks are not upgraded because of their internal auto-update capabilities and the conflict in these two auto-update mechanisms. See more details on docs.brew.sh/…

So if you want to upgrade casks as well, then run this (but read the warnings below first):

brew upgrade --greedy

If you do this, then be aware of this warning you will likely get:

Warning: Your terminal does not have App Management permissions, so Homebrew will delete and reinstall the app.
This may result in some configurations (like notification settings or location in the Dock/Launchpad) being lost.
To fix this, go to System Settings > Privacy & Security > App Management and add or enable your terminal.

So take these steps first:

  1. Click “Apple menu ”
  2. Click “System Settings”
  3. Click “Privacy & Security” (browsing takes a while as for ease of use, the list is *not* in alphabetical order)
  4. Click “App Management”
  5. If “Terminal” is listed, ensure it is enabled (the switch should be blue)
  6. If “Terminal” is not listed, add it and enable it

When you use another terminal application like iTerm2, then change the last 2 steps, see [Wayback/Archive] Michael Friedrich / dotfiles · GitLab

Security app permissions for iTerm2

Navigate into Settings > Security and Privacy > App Management and allow iTerm2 to modify apps. Otherwise you will see this warning on macOS Ventura 13.4.1.
Warning: Your terminal does not have App Management permissions, so Homebrew will delete and reinstall the app.
This may result in some configurations (like notification settings or location in the Dock/Launchpad) being lost.
To fix this, go to Settings > Security and Privacy > App Management and turn on the switch for your terminal.

If you have the permissions fixed with the above steps, then Homebrew can often upgrade the application using this:

brew upgrade --greedy

Note: Casks are always tricky, also because the tap for a cask can change effectively “upgrading” resulting in an unwanted version. A fix for this is mentioned at [Wayback/Archive] brew upgrade can actually downgrade casks in some configurations · Issue #17427 · Homebrew/brew · GitHub.

Archived links

  • [Wayback/Archive] brew – The Missing Package Manager for macOS (or Linux) — Homebrew Documentation (man page)
  • [Wayback/Archive] FAQ (Frequently Asked Questions) — Homebrew Documentation
    • [Wayback/Archive] FAQ (Frequently Asked Questions): Why aren’t some apps included during brew upgrade? — Homebrew Documentation

      Why aren’t some apps included during brew upgrade?

      After running brew upgrade, you may notice some casks you think should be upgrading, aren’t.

      As you’re likely aware, a lot of macOS software can upgrade itself:

      Sparkle update window

      That could cause conflicts when used in tandem with Homebrew Cask’s upgrade mechanism.

      When software uses its built-in mechanisms to upgrade itself, it happens without Homebrew Cask’s knowledge, causing both versions get out of sync. If you were to then upgrade through Homebrew Cask while we have a lower version of the software on record, you’d get a downgrade.

      There are a few ideas to fix this problem:

      • Try to prevent the software’s automated updates. It wouldn’t be a universal solution and may cause it to break. Most software on Homebrew Cask is closed-source, so we’d be guessing. This is also why pinning casks to a version isn’t available.
      • Try to extract the installed software’s version and compare it to the cask, deciding what to do at that time. It’d be a complicated solution that would break other parts of our methodology, such as using versions to interpolate url values (a definite win for maintainability). This solution also isn’t universal, as many software developers are inconsistent in their versioning schemes (and app bundles are meant to have two version strings) and it doesn’t work for all types of software we support.

      So we let software be. Anything installed with Homebrew Cask should behave the same as if it were installed manually. But since we also want to support software that doesn’t self-upgrade, we add auto_updates true to casks for software that does, which excludes them from brew upgrade.

      Casks which use version :latest are also excluded, because we have no way to track their installed version. It helps to ask the developers of such software to provide versioned releases (i.e. include the version in the path of the download url).

      If you still want to force software to be upgraded via Homebrew Cask, you can reference it specifically in the upgrade command:

      brew upgrade <cask>
      

      Or use the --greedy switch:

      brew upgrade --greedy

And a way longer Q&A at [Wayback/Archive] macos – Upgrade all the casks installed via Homebrew Cask – Stack Overflow

--jeroen

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.