20

How does homebrew/cask's updates work if the app auto updates itself.

Example: Chrome or Firefox

These two apps auto update themselves.

But what happens when you run a brew update?

Does it detect that it is already updated or does it check an internal list of apps it installed (misses that it is already updated) and reupdates the app>

5 Answers 5

13

brew cask upgrade is possible as of version 1.3.9

4
  • With the recents versions of Brew the correct syntax is brew upgrade cask
    – LuckyStarr
    Feb 14, 2019 at 8:31
  • @LuckyStarr this doesnt seem to be the case. brew upgrade cask on v2.0.1 gives me Error: cask not installed whereas brew cask upgrade works.
    – robjtede
    Feb 14, 2019 at 14:19
  • cask is a valid brew command which in turn have the command upgrade. But if you would like to update a brew formula the correct syntax is brew upgrade [formula].
    – LuckyStarr
    Feb 14, 2019 at 15:21
  • 10
    This answer doesn't actually answer the question. To be complete it needs to say what happens if the app has auto updated and someone runs brew cask upgrade.
    – steinybot
    May 17, 2019 at 20:08
13

The Homebrew Cask repository is technically a Homebrew Tap.

This means:

  • It will pull down the latest Casks every time you issue the Homebrew command brew update
  • You can check for outdated Casks with brew cask outdated and install the outdated Casks with brew cask upgrade

Most importantly for this question, applications that update themselves include auto_updates true. This means that these casks are ignored by brew cask outdated and brew cask upgrade. This can be overridden by adding --greedy to the command.

See the Firefox cask as an example:

  url "https://download-installer.cdn.mozilla.net/pub/firefox/releases/#{version}/mac/#{language}/Firefox%20#{version}.dmg"
  appcast 'https://www.macupdater.net/cgi-bin/check_urls/check_url_redirect.cgi?url=https://download.mozilla.org/%3Fproduct=firefox-latest-ssl%26os=osx'
  name 'Mozilla Firefox'
  homepage 'https://www.mozilla.org/firefox/'

  auto_updates true

Further reference is here.

1
8

Homebrew doesn't follow a new version of cask apps automatically, and you can leave such apps to their own auto updates as Homebrew intends to leave it to their own upgrade systems and e.g.

brew upgrade google-chrome

does nothing even when google-chrome has got a new update.

N.B. Now with Homebrew 2.5.5, brew cask was deprecated and integrated to the normal brew. If you want to do for cask explicitly, you may want --cask

brew upgrade --cask google-chrome

but all the same basically.

Should you want to follow the latest version on your Homebrew proper, you can run such a command as

brew upgrade --greedy google-chrome

Also you can check a diff between the latest and your local with

brew upgrade --greedy --dry-run google-chrome

This way however is mostly for cask apps without their own upgrade systems and you don't need these commands for those with the upgrade systems as long as you're not concerned about your version numbers on Homebrew.

2

No. There is no brew cask upgrade.

4
  • So what is the current procedure to update casks? Uninstall and reinstall? Dec 13, 2014 at 5:41
  • Yep, either use the app's built-in updater where applicable, or uninstall and reinstall.
    – Tim Smith
    Dec 14, 2014 at 6:27
  • The tracked Issue has been closed without adding an upgrade - they are going to be some restructuring of the project (see bottom of 'tracking' link, above, for more details)
    – notapatch
    Nov 13, 2015 at 11:58
  • 7
    brew cask upgrade is possible as of version 1.3.9
    – robjtede
    Dec 4, 2017 at 17:29
0

You can use the following command to upgrade all outdated casks.

brew list --cask | xargs brew upgrade --cask

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.