Homebrew / brew

🍺 The missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
41.13k stars 9.66k forks source link

brew upgrade <package> actually upgrades many packages #11778

Closed pingiun closed 3 years ago

pingiun commented 3 years ago

brew config output

HOMEBREW_VERSION: 3.2.4
ORIGIN: https://github.com/Homebrew/brew
HEAD: 071d769b00dca6abe73827fdc736d25372385105
Last commit: 8 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: de15ccd462bfddf164257815f20763f8984f9aa0
Core tap last commit: 52 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.HplsxDViPy/org.macosforge.xquartz:0
HOMEBREW_EDITOR: vim
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/bin/ruby
CPU: octa-core 64-bit skylake
Clang: 12.0.5 build 1205
Git: 2.30.1 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 11.4-x86_64
CLT: 12.5.0.22.9
Xcode: 12.5.1
XQuartz: 2.7.11 => /opt/X11

brew doctor output

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Some installed kegs have no formulae!
This means they were either deleted or installed with `brew diy`.
You should find replacements for the following formulae:
  unrar

Warning: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
  ilmbase
  lua@5.1
  node@10

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
  /opt/local/bin/pkg-config
  /opt/local/bin/icu-config
  /opt/local/bin/xslt-config
  /opt/local/bin/xml2-config
  /opt/local/bin/ncursesw6-config
  /opt/local/bin/pcre2-config
  /opt/local/bin/pcre-config
  /opt/local/bin/ncurses6-config

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
  /usr/local/lib/libgit2.0.28.2.dylib

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
  /usr/local/include/git2.h
  /usr/local/include/git2/annotated_commit.h
  /usr/local/include/git2/apply.h
  /usr/local/include/git2/attr.h
  /usr/local/include/git2/blame.h
  /usr/local/include/git2/blob.h
  /usr/local/include/git2/branch.h
  /usr/local/include/git2/buffer.h
  /usr/local/include/git2/checkout.h
  /usr/local/include/git2/cherrypick.h
  /usr/local/include/git2/clone.h
  /usr/local/include/git2/commit.h
  /usr/local/include/git2/common.h
  /usr/local/include/git2/config.h
  /usr/local/include/git2/cred_helpers.h
  /usr/local/include/git2/deprecated.h
  /usr/local/include/git2/describe.h
  /usr/local/include/git2/diff.h
  /usr/local/include/git2/errors.h
  /usr/local/include/git2/filter.h
  /usr/local/include/git2/global.h
  /usr/local/include/git2/graph.h
  /usr/local/include/git2/ignore.h
  /usr/local/include/git2/index.h
  /usr/local/include/git2/indexer.h
  /usr/local/include/git2/inttypes.h
  /usr/local/include/git2/mailmap.h
  /usr/local/include/git2/merge.h
  /usr/local/include/git2/message.h
  /usr/local/include/git2/net.h
  /usr/local/include/git2/notes.h
  /usr/local/include/git2/object.h
  /usr/local/include/git2/odb.h
  /usr/local/include/git2/odb_backend.h
  /usr/local/include/git2/oid.h
  /usr/local/include/git2/oidarray.h
  /usr/local/include/git2/pack.h
  /usr/local/include/git2/patch.h
  /usr/local/include/git2/pathspec.h
  /usr/local/include/git2/proxy.h
  /usr/local/include/git2/rebase.h
  /usr/local/include/git2/refdb.h
  /usr/local/include/git2/reflog.h
  /usr/local/include/git2/refs.h
  /usr/local/include/git2/refspec.h
  /usr/local/include/git2/remote.h
  /usr/local/include/git2/repository.h
  /usr/local/include/git2/reset.h
  /usr/local/include/git2/revert.h
  /usr/local/include/git2/revparse.h
  /usr/local/include/git2/revwalk.h
  /usr/local/include/git2/signature.h
  /usr/local/include/git2/stash.h
  /usr/local/include/git2/status.h
  /usr/local/include/git2/stdint.h
  /usr/local/include/git2/strarray.h
  /usr/local/include/git2/submodule.h
  /usr/local/include/git2/sys/alloc.h
  /usr/local/include/git2/sys/commit.h
  /usr/local/include/git2/sys/config.h
  /usr/local/include/git2/sys/diff.h
  /usr/local/include/git2/sys/filter.h
  /usr/local/include/git2/sys/hashsig.h
  /usr/local/include/git2/sys/index.h
  /usr/local/include/git2/sys/mempack.h
  /usr/local/include/git2/sys/merge.h
  /usr/local/include/git2/sys/odb_backend.h
  /usr/local/include/git2/sys/openssl.h
  /usr/local/include/git2/sys/path.h
  /usr/local/include/git2/sys/refdb_backend.h
  /usr/local/include/git2/sys/reflog.h
  /usr/local/include/git2/sys/refs.h
  /usr/local/include/git2/sys/repository.h
  /usr/local/include/git2/sys/stream.h
  /usr/local/include/git2/sys/time.h
  /usr/local/include/git2/sys/transport.h
  /usr/local/include/git2/tag.h
  /usr/local/include/git2/trace.h
  /usr/local/include/git2/transaction.h
  /usr/local/include/git2/transport.h
  /usr/local/include/git2/tree.h
  /usr/local/include/git2/types.h
  /usr/local/include/git2/version.h
  /usr/local/include/git2/worktree.h

Warning: Unbrewed '.pc' files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected '.pc' files:
  /usr/local/lib/pkgconfig/libgit2.pc

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause formulae that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  borgbackup
  ghostscript
  imath
  ipfs
  redis
  lua@5.1
  isort
  libvirt
  openexr
  mono
  kubernetes-cli
  six
  gnupg

Warning: Some taps are not on the default git origin branch and may not receive
updates. If this is a surprise to you, check out the default branch with:
  git -C $(brew --repo osx-cross/avr) checkout master

Warning: Homebrew's "sbin" was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting your PATH for example like so:
  echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc

What were you trying to do (and why)?

I was trying to upgrade my ffmpeg installation. I was using ffmpeg 4.4 and saw homebrew was going to upgrade to 4.4_2.

What happened (include all command output)?

So many packages got updated that I cannot scroll back far enough in my terminal to include all command output.

What did you expect to happen?

Only ffmpeg is upgraded

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

1. Have some outdated packages
2. Run `brew upgrade ffmpeg`
3. See many packages get updated
pingiun commented 3 years ago

I saw someone get the same problem in the comments here: https://stackoverflow.com/a/7898617, and searched the issue tracker for similar issues but couldn't find any

carlocab commented 3 years ago

brew upgrade ffmpeg will upgrade everything connected to ffmpeg via the dependency graph. To see a fragment of ffmpeg's dependency graph, do brew deps --tree ffmpeg.

This is only a fragment because we also need to append to that list each formula that (recursively) depends on each formula that appears in brew deps --tree ffmpeg. To see the formulae that need to be added to brew deps ffmpeg, you can probably do something like

brew deps ffmpeg | xargs -I{} brew uses --recursive --installed {} | sort | uniq

See https://docs.brew.sh/FAQ#why-does-brew-upgrade-formula-also-upgrade-a-bunch-of-other-stuff.