Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Homebrew updates and app self updates

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>

like image 259
PrivatMamtora Avatar asked Dec 13 '14 00:12

PrivatMamtora


People also ask

Does Homebrew automatically update packages?

Today by default, everytime you install a new package, brew will go ahead and automatically update all of my system packages to their latest versions.

How do you skip the brew update?

So ignoring a formula on brew upgrade is as simple as pinning it via brew pin <formula> . To un-pin it, simply invoke brew unpin <formula> . It is worth noting that brew upgrade <formula> will still update the formula regardless of whether or not it is pinned.

How do I update my apps in brew?

The first step is to run brew update . It updates Homebrew code and the taps (a tap is a repository of programs managed by Homebrew). Homebrew Cask provides the sub-command brew cask update but it is just an alias of brew update . You can use any of them; brew update is preferred because it is shorter.

How long does Homebrew update take?

From 20 minutes to an hour. The devs are aware.


3 Answers

brew cask upgrade is possible as of version 1.3.9

like image 171
robjtede Avatar answered Sep 22 '22 06:09

robjtede


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.

like image 35
Britt Selvitelle Avatar answered Sep 20 '22 06:09

Britt Selvitelle


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.

like image 28
lamusique Avatar answered Sep 18 '22 06:09

lamusique