Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac installer packages do not upgrade Homebrew from older versions #19287

Open
3 tasks done
aysiu opened this issue Feb 10, 2025 · 7 comments
Open
3 tasks done

Mac installer packages do not upgrade Homebrew from older versions #19287

aysiu opened this issue Feb 10, 2025 · 7 comments
Labels
bug Reproducible Homebrew/brew bug

Comments

@aysiu
Copy link

aysiu commented Feb 10, 2025

brew doctor output

brew doctor
Your system is ready to brew.

N/A. This is about the install/upgrade of Brew itself

Verification

  • My "brew doctor output" above says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update twice and am still able to reproduce my issue.
  • This issue's title and/or description do not reference a single formula e.g. brew install wget. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.

brew config output

brew config
HOMEBREW_VERSION: 4.4.20
ORIGIN: https://github.com/Homebrew/brew
HEAD: 47ef1a3b0b742a78be35c016df6a0279d6035ebb
Last commit: 7 days ago
Branch: master
Core tap JSON: 03 Feb 16:31 UTC
Core cask tap JSON: 03 Feb 16:31 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 3.3.7 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/bin/ruby
CPU: octa-core 64-bit arm_ibiza
Clang: 16.0.0 build 1600
Git: 2.39.5 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 15.2-arm64
CLT: 16.2.0.0.1.1733547573
Xcode: N/A
Rosetta 2: false

N/A

This is about the install/upgrade of Brew itself

What were you trying to do (and why)?

Upgrade brew via the installer, so we can keep it up to date

What happened (include all command output)?

Installing a new version of brew via the Mac installers at https://github.com/Homebrew/brew/releases doesn't upgrade the installed version of brew

What did you expect to happen?

If there's an older version of brew installed via an older installer, and you install brew via a newer installer, the installed brew version should be on the newer version.

Step-by-step reproduction instructions (by running brew commands)

Installed 4.4.18:

sudo installer -pkg ~/Downloads/Homebrew-4.4.18.pkg -target /
installer: Package name is Homebrew
installer: Upgrading at base path /
installer: The upgrade was successful.

Brew version is then 4.4.18:

/opt/homebrew/bin/brew --version
Homebrew 4.4.18

Installed 4.4.20:

 sudo installer -pkg ~/Downloads/Homebrew-4.4.20.pkg -target /
installer: Package name is Homebrew
installer: Upgrading at base path /
installer: The upgrade was successful.

Brew version is still 4.4.18:

/opt/homebrew/bin/brew --version                             
Homebrew 4.4.18

Even if you delete the `brew` binary and then reinstall, it's still the old version:

sudo rm /opt/homebrew/bin/brew


sudo installer -pkg ~/Downloads/Homebrew-4.4.20.pkg -target /
installer: Package name is Homebrew
installer: Upgrading at base path /
installer: The upgrade was successful.


/opt/homebrew/bin/brew --version                     
Homebrew 4.4.18

It's only if you blow out the entire subdir and then install the new version that the new version gets recognized as being installed:

sudo rm -rf /opt/homebrew 


sudo installer -pkg ~/Downloads/Homebrew-4.4.20.pkg -target /
installer: Package name is Homebrew
installer: Upgrading at base path /
installer: The upgrade was successful.


/opt/homebrew/bin/brew --version                 
Homebrew 4.4.20

The installer package should have `brew --version` report back the version that the installer installed.
@itsmikesharescode
Copy link

experience the same hard stuck at upgrade/update is there other way?

@gromgit
Copy link
Contributor

gromgit commented Feb 12, 2025

experience the same hard stuck at upgrade/update is there other way?

Is brew update not working for you?

@aysiu
Copy link
Author

aysiu commented Feb 12, 2025

A newer .pkg should upgrade an older .pkg's installation.

@carlocab
Copy link
Member

carlocab commented Feb 12, 2025

It might just be the cached version. Try doing

rm -rf "$(brew --repo)/.git/describe-cache"

after updating to make sure the version output isn't stale.

@itsmikesharescode
Copy link

experience the same hard stuck at upgrade/update is there other way?

Is brew update not working for you?

Yes, is there a workaround? I was trying to run brew upgrade supabase but it kept failing, so I decided to reinstall it. Now I'm stuck with a connection update error even though my internet is working at peak speed.

@gromgit
Copy link
Contributor

gromgit commented Feb 12, 2025

Yes, is there a workaround?

Well, you could manually run a git pull on each Homebrew repo directory, but a more useful diagnosis would require that you reveal the exact (error) output of brew update (and brew upgrade supabase, since you're having problems with that too)..

@itsmikesharescode
Copy link

Yes, is there a workaround?

Well, you could manually run a git pull on each Homebrew repo directory, but a more useful diagnosis would require that you reveal the exact (error) output of brew update (and brew upgrade supabase, since you're having problems with that too)..

never mind it works now i just clear the cache carlocab said thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reproducible Homebrew/brew bug
Projects
None yet
Development

No branches or pull requests

4 participants