Open seanshpark opened 2 years ago
My internal SSD is 256G, not enough to install programs without worry...
Let's use SSD for home of brew.
Installation
follow https://github.com/Homebrew/brew/blob/master/docs/Installation.md
cd /Volumes/SSD
git clone https://github.com/Homebrew/brew homebrew
eval "$(homebrew/bin/brew shellenv)"
brew update --force --quiet
chmod -R go-w "$(brew --prefix)/share/zsh"
add to PATH
export PATH=/Volumes/SSD/homebrew/bin:$HOME/bin:$PATH
Cache files in $HOME/Library/Caches
?
There's an environment variable that can redirect to external drive
export HOMEBREW_CACHE=/Volumes/HDD/Library.user/Caches/Homebrew
Installing python3
brew install python3
brew install python3-pip --> X
brew install python3-venv --> X
Add: warnings while running brew install python3
Warning: Building pkg-config from source:
The bottle needs to be installed into /opt/homebrew
...
Warning: Building openssl@1.1 from source as the bottle needs:
- HOMEBREW_CELLAR: /opt/homebrew/Cellar (yours is /Volumes/SSD/homebrew/Cellar)
- HOMEBREW_PREFIX: /opt/homebrew (yours is /Volumes/SSD/homebrew)
...
Warning: Building python@3.9 from source:
The bottle needs the Apple Command Line Tools to be installed.
You can install them, if desired, with:
xcode-select --install
brew install virtualenv
need a reboot to use brew python3 instead of system /usr/bin/python3
--> open new terminal
mac's python 2.x is in /System
as
ll /System/Library/Frameworks/Python.framework/Versions
total 0
drwxr-xr-x 7 root wheel 224 Dec 8 08:39 ./
drwxr-xr-x 5 root wheel 160 Dec 8 08:39 ../
lrwxr-xr-x 1 root wheel 3 Dec 8 08:39 2.3@ -> 2.7
lrwxr-xr-x 1 root wheel 3 Dec 8 08:39 2.5@ -> 2.7
lrwxr-xr-x 1 root wheel 3 Dec 8 08:39 2.6@ -> 2.7
drwxr-xr-x 11 root wheel 352 Dec 8 08:39 2.7/
lrwxr-xr-x 1 root wheel 3 Dec 8 08:39 Current@ -> 2.7
but python3 is in usr/bin
ll /usr/bin/python3
-rwxr-xr-x 1 root wheel 167088 Dec 8 08:39 /usr/bin/python3*
--
manually add symbolic link in homebrew/bin
cd .../homebrew/bin
ln -s python3 python
and as before, need reboot to take effect...? --> open new terminal
Hi,
you don’t need to reboot, just start a new shell session. If it does not work it is configured wrong.
Homebrew installs “formulae” in /usr/local/Cellar
, not in ………/homebrew/bin
. It creates symlinks in /usr/local/bin
and/or /usr/local/opt
and updates them when a formula is updates. Instead of trying to install Homebrew into another location install it the normal way and move Cellar
to your external SSD, then create a symlink: ln -s /Volumes/SSD/Cellar /usr/local/Cellar
(same for “casks”, they are in /usr/local/Caskroom
)
You should not have ………/homebrew/bin
in PATH. Instead, have /usr/local/bin
before /usr/bin/
in PATH. This should be pre-configured in Big Sur and newer (don’t know if it was in Catalina already). Check your PATH with printenv PATH
and, if needed, edit /private/etc/paths
.
You also should not try to symlink python3
as python
, it can cause many problems.
Read: https://docs.brew.sh/Homebrew-and-Python and https://docs.python-guide.org/starting/install3/osx/
you don’t need to reboot, just start a new shell session. If it does not work it is configured wrong.
Wow, may thanks! I didn't expect someone will look at my logging :) I'll study more and check my configuration!
What should happen
Cellar
to /usr/local/xxx
instead in homebrew/xxx
xxx
are bin, lib, include, share
and more?Wow, may thanks! I didn't expect someone will look at my logging :) I'll study more and check my configuration!
I came across it while browsing GitHub while bored on the train 😉
What should happen
- symbolic links from
Cellar
to/usr/local/xxx
instead inhomebrew/xxx
- where
xxx
arebin, lib, include, share
and more?
You don’t have to create symlinks, Homebrew does it for you. Under /usr/local/Homebrew/
is the program itself installed but not the packages. The packages are installed under /usr/local/Cellar
in sub-dirs with the version number in their names. Every time you upgrade, the version number is changed.
When it upgrades packages, Homebrew will re-create/change symlinks or move/copy files to their needed locations. So you don’t have to care about.
You can do: Move the Cellar
directory to your external drive and create a symlink (ln -s /Volumes/SSD/Cellar /usr/local/Cellar
). You could use the environment variable HOMEBREW_CELLAR
but then you have to change more than only that.
node install
brew install node
% node --version
v17.3.0
% npm --version
8.3.0
brew install llvm
To use the bundled libc++ please add the following LDFLAGS:
LDFLAGS="-L/Volumes/SSD/homebrew/opt/llvm/lib -Wl,-rpath,/Volumes/SSD/homebrew/opt/llvm/lib"
llvm is keg-only, which means it was not symlinked into /Volumes/SSD/homebrew,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have llvm first in your PATH, run:
echo 'export PATH="/Volumes/SSD/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc
For compilers to find llvm you may need to set:
export LDFLAGS="-L/Volumes/SSD/homebrew/opt/llvm/lib"
export CPPFLAGS="-I/Volumes/SSD/homebrew/opt/llvm/include"
Playing with Homebrew...