brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: brew autoremove -n shows which leftover Homebrew dependencies can go

Terminal
~/tips/tip-terminal-brew-autoremove

brew autoremove -n

Lists and removes packages that only came along as a dependency and are unused now.

Uninstall a tool with Homebrew and the libraries it pulled in stay behind. Over time that adds up.

Homebrew remembers which formulae you asked for and which came along as dependencies. autoremove removes the dependencies that nothing needs anymore. I’d always look first:

brew autoremove -n

-n, long form --dry-run, lists what would be uninstalled and changes nothing. If the list looks right, run it for real:

brew autoremove
brew cleanup

cleanup then deletes old downloads and outdated versions from the cache, which often frees more space than the packages themselves.

The list is only as good as Homebrew’s idea of what you installed on purpose. If you once used a library directly, say openssl@3 for a build script, but it was installed as a dependency, it shows up here and gets removed. In that case mark it as yours with brew tab --installed-on-request openssl@3, and autoremove leaves it alone. Anything you compiled yourself against those libraries is invisible to Homebrew, so a quick test of your own tools after a cleanup is wise.

Further reading: brew manpage (Homebrew docs)

More Terminal tips ioreg -rn AppleSmartBattery | grep CycleCount Terminal can save your windows and tabs as a window group Export a Terminal profile to a .terminal file and import it on another Mac mc hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x700000029}]}' All Terminal tips (116) All topics

Link