Brew doctor picking up files in /usr/local under linuxbrew

(Samantha Demi) #1

Hi, i’m using linuxbrew in a WSL environment and I keep running into issues with invoking brew doctor and getting what seem to be erroneous reports about files not under the installation prefix. my understanding is that linuxbrew works in a similar manner to homebrew on mac, however on Linux to avoid use of sudo the packages (as well as the package manager itself) is installed to the /home/linuxbrew/.linuxbrew directory. this is what my brew --prefix path outputs as. my understand of homebrew/linuxbrew is that it’s supposed to use it’s own dependencies for installations, which are installed to the prefix path that the installation carries. thus I am confused when I run brew doctor and get a bunch of warnings about other, non-homebrew, files/executables/libraries installed under the path /usr/local/{bin/lib/share/…}. am I missing something here with regards to the importance of this directory, that otherwise appears to be completely unrelated to my linuxbrew install? is there any way to get it to perform the checks using the “correct” (/home/linuxbrew/.linuxbrew) prefix instead??


(Jonathan Chang) #2

All Linuxbrew binary packages (bottles) are built in an isolated environment, so they shouldn’t pick up system dependencies in /usr/local/. However, we’re currently unable to prevent formulae built from source from picking up system dependencies, so the warning is there to say that things might break. Don’t worry about these doctor messages unless you’re having trouble with something you’ve installed.

(Samantha Demi) #3

thanks, that makes sense. I don’t want to worry about these brew doctor messages, is there a way I can whitelist some things or get them to be suppressed somehow so that they don’t make it harder to see actual problems with my homebrew configuration? I assume that I wouldn’t be getting these messages had they been installed under /usr instead of /usr/local and would still present the same potential problem there; so while I get that this codebase is shared with the mac version which does have to worry about things placed under /usr/local by the user moreso than linuxbrew does, is there some middleground so i’m not being bombarded with information that is already known to me?

(Mike McQuaid) #4

/usr/local is a default compiler path which is why Homebrew complains; things that are built from source (particularly using stuff like e.g. CMake) are known to pick them up and fail to build as a result.

(Samantha Demi) #5

right, I understand and am capable of resolving those kind of issues when they arise; i’m just trying to see if i can get brew doctor to show problems other than the 1-2 exotic packages I have installed under that location.

(Shaun Jackman) #6

Packages installed from source into /usr/local/ anecdotally tend to cause more trouble than software installed by the host’s package manager into /usr/. If you would like to silence the brew doctor warnings, I suggest uninstalling the packages in /usr/local/, and instead install them in $HOME/.local/, where they are less likely to cause trouble.

(Samantha Demi) #7

okay, it seems like the answer to my question is “no”; alright, thanks for the info everyone.