brew upgrade <package> just upgrades everything #3126
Replies: 6 comments 20 replies
-
There is almost nothing that should require this on M1 unless you installed in a non-default location. The explanation for your initial question is here though: TL;DR install in the default location and regularly update your software and you won't have this issue. |
Beta Was this translation helpful? Give feedback.
-
I have it installed in the "default location", I upgrade it pretty regularly (actually because it just downloads every single forumula every time I make the mistake of installing any new formula ) and tried to install GPG. It's been installing newovim, erlang, and ever other gosh darn thing it can get its hands on. This should NOT be default behaviour, and if it's going to do something like this, it should at least warn the user and give them the option of opting out. Sometimes, we really don't need to burn our battery trying to install what we think might be just one package and a couple dependencies. I fail to see how how neovim and erlang formulas are somehow a dependency for gpg. It's just upgrading/re-installing everthing and that's not a good trip. |
Beta Was this translation helpful? Give feedback.
-
Upgrade with brew install php instead of brew upgrade php |
Beta Was this translation helpful? Give feedback.
-
I found a related discussion here https://github.com/orgs/Homebrew/discussions/57 but that was locked, so I will add my 2c here. I have just run a Based on the linked discussion, this is just how things work with reverse dependency resolution, and I am not trying to change that philosophy. What I really think, though, is that there should be a default behavior of warning the user and requiring a confirmation (in an interactive session, to avoid the "but what about CI argument"). Brew must know what it will do with what packages, so it should not be very difficult to display the proposed changes to the user and just ask "are you ok with this"? (for random people who might stumble here -- the command to revert PHP at least is |
Beta Was this translation helpful? Give feedback.
-
My solution to this is remove anything I am not using currently. This avoids the huge deps trees homebrew needs to upgrade. |
Beta Was this translation helpful? Give feedback.
-
So I wanted to try and upgrade a single package, specifically
php
. At the time of writing, that's PHP 8.1.4So the command I entered was
brew upgrade php
since the brew documentation/help text lead me to believe this would ONLY update the single package.However, brew seems to just completely ignore this and decides to upgrade everything anyway? Can someone please explain why? This seems like incredibly bad design, since all I wanted to do was upgrade PHP 8.1 a few patch versions which realistically would take 20-30 seconds max, and instead a number of completely unrelated packages also got upgraded leading to my upgrade of "only php 8.1" taking well over 20+ minutes. Because I'm on an M1 Mac, a lot of these packages have to be built from source which takes a considerable amount of time and absolutely destroys battery life because some of them are absolutely huge and take upwards of 10+ minutes to compile.
I understand dependencies of PHP 8.1 needing to be upgraded since, well they are dependencies that it relies on. But brew seriously just decides it's going to upgrade everything, including packages that I'm confident have very little to do with PHP 8.1. For example;
I'm not sure if I'm using the command wrong, but I seem to be using it exactly as the documentation suggests and it seems to just not work any different from just writing
brew upgrade
.If this is the case, then what exactly is the point in specifying the package in the command in the first place?
Beta Was this translation helpful? Give feedback.
All reactions