要在Ubuntu上自定义安装路径,可以按照以下步骤操作:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
~/.bashrc
或~/.zshrc
,添加以下内容:export PATH="/path/to/custom/installation/dir/bin:$PATH"
export HOMEBREW_PREFIX="/path/to/custom/installation/dir"
export HOMEBREW_CELLAR="/path/to/custom/installation/dir/Cellar"
export HOMEBREW_REPOSITORY="/path/to/custom/installation/dir"
将/path/to/custom/installation/dir
替换为你希望安装Homebrew的自定义路径。
source ~/.bashrc
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
这样,Homebrew就会被安装到你指定的自定义路径中。