溫馨提示×

homebrew在ubuntu上的自定義安裝路徑

小樊
86
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,添加以下內(nèi)容:
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