Skip to content

FAQ.md: Suggested improvements #20335

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

FAQ.md: Suggested improvements #20335

wants to merge 1 commit into from

Conversation

agowa
Copy link
Contributor

@agowa agowa commented Jul 30, 2025

Added mention of some environment variables to already mentioned command line examples.

Expanded section for dealing with keg-only libraries by providing a c'n'p-able configuration snippets that should fit most use cases.

Fix some formatting inconsistencies (like disable being written like bolded in one example but not for another within the same section of the FAQ right after each other.

Mention disabling automatic updates and upgrades using environment variables.

Add note about a bunch of packages requiring sudo despite it being mentioned as no-go right now.

Mention manual alternative of just removing the xattr property for unblocking "unknown developer" applications. So that users know how this protection feature works.

Add mention of HOMEBREW_UPGRADE_GREEDY where currently only the CLI version is mentioned.

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Added mention of some environment variables to already mentioned command line examples.

Expanded section for dealing with keg-only libraries by providing a c'n'p-able configuration snippets that should fit most use cases.

Fix some formatting inconsistencies (like disable being written like bolded in one example but not for another within the same section of the FAQ right after each other.

Mention disabling automatic updates and upgrades using environment variables.

Add note about a bunch of packages requiring sudo despite it being mentioned as no-go right now.

Mention manual alternative of just removing the xattr property for unblocking "unknown developer" applications. So that users know how this protection feature works.

Add mention of HOMEBREW_UPGRADE_GREEDY where currently only the CLI version is mentioned.
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Please scope this back more tightly to specifically upgrades.

@@ -25,7 +25,11 @@ Upgrade everything with:

brew upgrade

Or upgrade a specific formula with:
Upgrade everything __including__ casks with `auto_update: true` and `version :latest`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think the various __ usage added here aids readability and it's inconsistent with existing style

Comment on lines +72 to +80
To __disable__ these automatic upgrades:

export HOMEBREW_NO_INSTALL_UPGRADE=1

Additionally there is also the automatic update of all package definitions (formulae) and Homebrew itself (e.g. automatic `brew update`) when certain actions like `brew upgrade`, `brew install`, or `brew tap` are run. This may look like brew is updating other things but doesn't change the installed versions of packages.

To __disable__ these automatic updates of the package definitions and Homebrew itself:

export HOMEBREW_NO_AUTO_UPDATE=1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would rather not recommend these here. They break things.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will think about rewording it. It is a quite common question and I think it is better people look here than in some random Gemini generated google response so I'd kinda like to have it in here.

I'm open to suggestions, I'm using them as I work mostly on Linux systems and there you also have to invoke it as a separate command. It's always quite unexpected and I always Ctrl+C immediately as I think I accidentally approved the dependency resolver to either install the entire world or to remove the entire system...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so I'd kinda like to have it in here.

I would like to not have it here, please remove it.

@@ -124,6 +138,8 @@ Did you `chown root /Applications/TextMate.app`? Probably not. So is it that imp

If you need to run Homebrew in a multi-user environment, consider creating a separate user account specifically for use of Homebrew.

Some formulae or casks however may require elevation using `sudo` and therefore the installation or upgrade of these may block and ask for your password, fingerprint, or smartcard pin to authorize. This happens for apps like e.g. Microsoft Teams that install things like an additional audio device or similar.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No formalae use sudo. Just say credentials and don't mention Teams specifically.

Copy link
Contributor Author

@agowa agowa Jul 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right they're all casks. Should have looked more closely at the search results over in the homebrew-core repo I had earlier.
However I could have sworn that I've seen some formulae requesting sudo as well...

Also why I used the Teams example is I wanted to show why it may be desired and unavoidable. E.g. for installing a pseudo device driver. Will think about how to reword this as well.

Comment on lines +198 to +222
A kinda generic to use libraries from "keg-only" packages like e.g. zlib would be:

# set temporary variables:
_brew_package_name="zlib"
_brew_package_prefix="$(brew --prefix $_brew_package_name)"
# For the C and C++ linker (lld):
export LDFLAGS="-L$_brew_package_prefix/lib $LDFLAGS"
# For the C and C++ pre-processor:
export CPPFLAGS="-I$_brew_package_prefix/include $CPPFLAGS"
# For the Rust:
export RUSTFLAGS="-L$_brew_package_prefix/lib $RUSTFLAGS"
# For pkg-config:
export PKG_CONFIG_PATH="$_brew_package_prefix/lib/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}"
export PKG_CONFIG_LIBDIR="$_brew_package_prefix/lib/pkgconfig${PKG_CONFIG_LIBDIR:+:${PKG_CONFIG_LIBDIR}}"
# If the package also contains binaries uncomment the following line:
#export PATH="$_brew_package_prefix/bin:/homebrew/sbin:/usr/local/sbin${PATH:+:${PATH}}"
# unset temporary variables again
unset _brew_package_name _brew_package_prefix

**NOTE**: The above example is written in a way that allows you to put multiple copies of it into your .zshrc (or .bashrc) and only having to
change the package name within the first line without them overwriting each other.
Similarly it won't overwrite any existing ones you may already have.
All of them will be merged together properly in the end.
This way your file stays neath and tidy and you'll be able to easily find the lines for a specific package should you want to remove them later on again.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove all of this, this is overkill

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, either this or some kind of command line flag to auto generate it like e.g. PIPX does.
I wrote these commands already generic enough that we could do that as well and a --create-shell-profile-env-overwrite.

I'd like to have something here at least. Especially for non-programmer managing to identify the correct Environment variable to set so that some script works on macOS can be quite a challenging task...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to have something here at least.

Please remove it for now.

Comment on lines +247 to +250
For consolle application, granting your terminal emulator (e.g. iTerm2.app) the "Developer Tools" permission can also help as this allows it to run untrusted applications. **Note**: It is not recommended to do this for the builtin macOS Terminal app, as this may also allow other application and scripts to bypass this protection.

Finally, of course it is also possible to remove the `com.apple.quarantine`-flag from the affected files using tools like `xattr` manually.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not recommend this please

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a recommendation. I intentionally didn't write the actual command. My goal was to explain how this works. Maybe could be shortened or reworded though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anything implicitly in the official documentation can be interpreted as a recommendation. Please remove.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I totally agree this shouldn't be in the official docs, it is worth noting that there are lots of new formula doing this since the Goreleaser Formula → cask change (https://github.com/orgs/goreleaser/discussions/5563#discussioncomment-13368648)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants