How to install homebrew to /usr rather than /usr/local I'm wondering if it is possible (and if so, how) to install Homebrew package manager to /usr directory rather than /usr/local directory. I have macOS High Sierra.
One way is to modify the install.sh script in homebrew git source and change HOMEBREW_PREFIX to point to whereever you want homebrew to install.
In my case, I've decided to use /usr/local2, because of some restrictions on /usr/local in OSX Catalina, so modify install.sh with HOMEBREW_PREFIX=/usr/local2 and HOMEBREW_REPOSITORY=/usr/local2/Homebrew before running ./install.sh.
Two problems you have to watch:

Some packages insist on installing in /usr/local unless you manually hunt down and modify the source (not trivial)
Installing in a directory that already has similar/equal files can overwrite them and render your system unstable. Especially /usr, where a lot of system commands exist there, which you never want to replace at all.