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

brew autoremove not removing stuff #18529

Open
3 tasks done
dimaqq opened this issue Oct 8, 2024 · 2 comments
Open
3 tasks done

brew autoremove not removing stuff #18529

dimaqq opened this issue Oct 8, 2024 · 2 comments
Labels
bug Reproducible Homebrew/brew bug

Comments

@dimaqq
Copy link

dimaqq commented Oct 8, 2024

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 casks are deprecated or disabled.
You should find replacements for the following casks:
  meld

Warning: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
  juju-wait

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/node/cppgc/common.h
  /usr/local/include/node/js_native_api.h
[so many files]
  /usr/local/include/node/zlib.h

Warning: Homebrew's "sbin" was not found in your PATH but you have installed
formulae that put executables in /opt/homebrew/sbin.
Consider setting your PATH for example like so:
  fish_add_path /opt/homebrew/sbin

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

HOMEBREW_VERSION: 4.4.0
ORIGIN: https://github.com/Homebrew/brew
HEAD: 84c31175f11860129a9aaed40a13c549625e2db1
Last commit: 7 days ago
Core tap JSON: 08 Oct 06:42 UTC
Core cask tap JSON: 08 Oct 06:42 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_EDITOR: vim
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 3.3.5 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.5/bin/ruby
CPU: octa-core 64-bit arm_blizzard_avalanche
Clang: 16.0.0 build 1600
Git: 2.47.0 => /opt/homebrew/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 15.0.1-arm64
CLT: 16.0.0.0.1.1724870825
Xcode: N/A
Rosetta 2: false

What were you trying to do (and why)?

Trying to remove stale deps.
I ran "brew upgrade" and there were so many, what's "wangle"?

I've checked brew deps --tree --installed | view - and realised that was brought in by watchman.

I removed watchman, but that didn't remove edencommon.
So I removed edencommon, but that didn't remove fb303.
etc. etc.

What happened (include all command output)?

brew remove fbthrift
Uninstalling /opt/homebrew/Cellar/fbthrift/2024.10.07.00... (881 files, 27.6MB)

brew autoremove
[no output; retval OK]

What did you expect to happen?

for brew to remove the stale deps

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

Weirdly, if I `brew install watchman` again, it installs 3 packages (watchman, fb303, edencommon) and reuses the other deps.

When `brew remove watchman` it removes (edencommon,fb303,fbthrift) and doesn't remove the other deps.

It's as if my system state got weird, as if every dependency got marked as "explicitly installed".
@dimaqq dimaqq added the bug Reproducible Homebrew/brew bug label Oct 8, 2024
@dimaqq
Copy link
Author

dimaqq commented Oct 8, 2024

P.S. doctor output doesn't say ready to brew maybe doctor output was changed? It does tell me that everything is working fine.

@gromgit
Copy link
Member

gromgit commented Oct 8, 2024

It's as if my system state got weird, as if every dependency got marked as "explicitly installed".

What's the output of brew leaves --installed-on-request? These are the formulae that are not used by other installed formulae, but will never be autoremoved, because you either did brew install for them at some point, or your Homebrew state "got weird" somehow.

Make a list of the formulae above that you're absolutely sure you never manually installed and you don't want on your system at this point, then:

brew tab --no-installed-on-request <list_of_non-manually-installed_formulae>

then a subsequent brew autoremove should do what you intended.

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

2 participants