ubuntu安装Homebrew完整版

需要在非root用户下安装,该用户还需要具备sudo权限

安装依赖环境

sudo apt install curl git build-essential -y

配置清华镜像源

cat>>~/.bashrc<<EOF
export HOMEBREW_API_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
export HOMEBREW_PIP_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple"
EOF
source ~/.bashrc

安装

git clone --depth=1 https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/install.git brew-install
bash brew-install/install.sh

设置环境变量

(echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> ~/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

brew的基本操作命令

# 更新
brew update

# 安装指定软件
brew install xxx

# 查看所有已安装软件
brew list

# 卸载指定软件
brew uninstall xxx

参考资料:

发表评论

后才能评论