温馨提示×

homebrew在ubuntu上的自定义安装路径

小樊
102
2024-08-18 22:57:36
栏目: 智能运维

要在Ubuntu上自定义安装路径,可以按照以下步骤操作:

  1. 首先,下载Homebrew的安装脚本并运行:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. 然后,编辑Homebrew的配置文件~/.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的自定义路径。

  1. 运行以下命令更新配置文件:
source ~/.bashrc
  1. 最后,重新安装Homebrew到自定义路径:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

这样,Homebrew就会被安装到你指定的自定义路径中。

0