4 ms·
It doesn't upgrade everything. It upgrades dependencies and dependents of those dependencies (which, admittedly, can feel like everything). It does this because
by mikemcquaid 5y ago
It doesn't upgrade everything. It upgrades dependencies and dependents of those dependencies (which, admittedly, can feel like everything). It does this because the alternative is sometimes breaking things.
A "breaking things without this example":
- you want to install something that depends on `readline`
- the binary package for the thing you want requires the latest `readline`
- this upgrades `readline` on installation
Now, we have a choice. Either we upgrade _everything_ that depends on `readline` that you have installed or we knowingly break some of the things you have installed that depend on `readline`. We choose the safer option by default.
If you leave it a long time between updating: you are more likely to have more dependencies updated which requires more dependents to be updated.
- ayewo 5y agoI'm inclined to agree, but it seems Ubuntu's solution to this problem with "apt install <package> [-y]" where you are presented with a list of dependencies that will get upgraded if you choose to proceed is a much better trade off. The user can of course ignore the dependencies notice by specifying the "-y" flag to force an installation.
- mdaniel 5y agoI hadn't actually considered it until you explicitly mentioned it, but yes: I'd bet a lot of the frustration when using brew would go down if brew just chose to _say_ what it was going to do, and _ask_ if that was ok, instead of assuming the user completely delegates that choice over to brew I am aware of the "brew pin" command, and I do think it would have saved OP some heartache, but I think your suggestion of prompting before transitive changes would be the most pro-user way
- mikemcquaid 5y agoThat would be a breaking change for most scripts so would need to be optional (which feels less useful for people).
- jolux 5y agoI see. That makes sense. Seems like the documentation for that environment variable could use some work, unless this behavior and the reasons for it already exist elsewhere. Happy to submit a PR if needed. I do try to `brew upgrade` at least once a day, so that probably softens the blow of these automatic upgrades and explains why I haven't run into many problems with them. > the binary package for the thing you want requires the latest `readline` Have you considered trying to install the latest version of the thing that would be satisfied with the `readline` you already have installed (if it exists), or presenting the user with a choice on whether to upgrade or abort the install?