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 pin keeps one Homebrew package at its version in the terminal

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

brew pin node

Stops brew upgrade from touching one formula you depend on.

brew upgrade updates everything at once, which is great until one tool’s new version breaks your project. You can hold that one back.

Pin the formula and upgrades skip it:

brew pin node
brew list --pinned
brew upgrade

brew upgrade now leaves node alone and says so in its output. When you are ready, release it:

brew unpin node

I would pin for a reason I can name, like a database whose data format changes between versions or a compiler a project is tested against. Write that reason down somewhere, because a pin you forgot about turns into a very old, unpatched package.

For anything with a versioned formula, such as postgresql@16 or [email protected], installing that one is often cleaner than pinning the plain name. It never jumps a major version by itself.

Homebrew warns about the side effect itself: other packages that need a newer version of a pinned formula may fail to install or run. A pinned cask that updates itself, like many browsers, can still update outside Homebrew.

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