brew upgrade --fetch-only versus --quiet for low-noise update alerts
0 reputation · 15 Feb 2024, 01:16 UTC
0 reputation · 15 Feb 2024, 01:16 UTC
I need a periodic Homebrew check that alerts me only when a formula has a new version that can be upgraded without hidden dependency problems, while keeping terminal output and log noise to a minimum.
Two documented approaches are available: brew upgrade --fetch-only stages the download without installing, letting brew outdated show upgradable formulae, and brew upgrade --quiet performs the upgrade but suppresses progress bars and standard output, relying on exit codes and error messages for alerts.
I am unsure which approach better balances low noise with visibility of critical warnings that could block a successful upgrade.
--fetch-only combined with brew outdated reliably surface dependency conflicts that would appear during an actual upgrade?--quiet be trusted to expose important warnings through its exit code or error output, or does it risk hiding them?32775 reputation · 15 Feb 2024, 02:25 UTC
Short answer: neither flag alone does what you want. brew outdated is the right alerting primitive, and --fetch-only is a safe staging step — but neither one can promise an upgrade is free of dependency problems. --quiet is the wrong tool for monitoring because it performs the actual upgrade rather than just reporting on it.
Confirmed behavior (well-established in Homebrew):
brew outdated compares installed versions against available versions and makes no system changes. It is the canonical "is anything upgradable?" check.brew upgrade --fetch-only downloads the new packages into Homebrew's cache without installing or linking them.brew upgrade --quiet still runs the complete upgrade; it only suppresses progress output on stdout. Errors still go to stderr and failures still produce a non-zero exit code.Likely, but not guaranteed: a conflict that only appears at install or link time (for example, a keg that cannot be linked because of leftover files, or a broken dependency in a third-party tap) will not be surfaced by --fetch-only. Fetching validates that the download works, not that the install will succeed.
brew outdated is a version comparison only, and --fetch-only stops before the resolution, build, and link phases where most conflicts appear. Treat a successful fetch as "the download is staged," not "the upgrade is safe."brew outdated. It fires only when a newer version actually exists, so every alert is real. The trade-off is that "upgradable" is not the same as "will upgrade cleanly" — and no read-only Homebrew command fully closes that gap.There is no Homebrew flag that dry-runs a full upgrade including dependency resolution and linking. If "actionable without hidden dependency problems" is a hard requirement, the practical ceiling is: alert on brew outdated, optionally pre-stage with --fetch-only, and accept that the final upgrade is the first moment conflicts can truly surface. Capturing stderr from the real upgrade (quiet or not) is how you catch those.
Assumption: standard Homebrew on macOS or a supported Linux setup, recent Homebrew 4.x. Behavior with third-party taps carrying custom install logic can differ, and I have not verified flag behavior against a specific pinned Homebrew release.
Use comments to ask for clarification. Post a solution as an answer.
32,775 reputation · 15 Feb 2024, 06:44 UTC
When brew upgrade --quiet runs, progress bars and informational messages output to stdout, while diagnostic errors and warnings go to stderr. Redirecting only stdout to /dev/null still exposes stderr errors, but non-fatal warnings can be mixed with other diagnostics and are not always distinguishable by exit code alone. Homebrew output routing semantics have been consistent across recent releases, but flag behavior can vary by version—always verify on your installed CLI. For reliable low-noise monitoring, pipe stderr to a dedicated log file (2>/tmp/brew-warn.log) and inspect its contents alongside the exit code; a zero exit code does not guarantee the absence of deprecation or dependency warnings that could affect future upgrades.