Homebrew#
大多数包管理器都需要 root 权限,在超算平台上无法使用。虽然官方明确不给予支持,但 Homebrew 确实能够在完全无 root 的情况下使用。
第一步 下载 Homebrew#
在继续之前,请确保已参考《创建隔离空间》完成隔离空间的创建。不要为其他人安装。
git clone --depth 1 https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git ~/.homebrew第二步 配置环境变量#
在 ~/.bashrc 中添加:
# ===== Homebrew =====
eval "$(~/.homebrew/bin/brew shellenv)"
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_API_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"
# ===== Homebrew =====如果不想使用镜像源,就不需要设置下方四个环境变量。
完成后,启动新的 bash 让配置生效。
第三步 更新 Homebrew#
brew update第四步 配置 homebrew/core 镜像#
brew tap --force --custom-remote homebrew/core https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git如果不想使用镜像源,可以跳过此步。
第五步 尝试安装包#
brew install hugo
hugo help第六步 更多内容#
无 root 使用是明确不受 Homebrew 官方支持的:很多包可能不得不从源码编译,而由于环境的复杂性,未必总能成功;同时, Homebrew 也不保证网络接口的稳定,因此镜像源未必稳定。如果遇到问题,可以进一步查阅: