我想在我的 mac 系统上安装 homebrew,但无法安装。安装过程给我错误。
error: could not lock config file /usr/local/Homebrew/.git/config: Permission denied
fatal: could not set 'core.repositoryformatversion' to '0'
Failed during: git init -q
我尝试过以下命令来安装自制软件
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
删除当前安装:
sudo rm -rf /usr/local/Homebrew
然后再次安装,而不使用sudo:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
位置已经改变,所以现在使用这个:
sudo rm -rf /opt/homebrew
并再次安装:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
删除自制目录:
sudo rm -rf /usr/local/Homebrew
rm -rf ~/.homebrew
使用 SSH 链接克隆 Homebrew:
git clone [email protected]:Homebrew/brew.git ~/.homebrew
将 Homebrew 添加到您的路径:
echo 'export PATH="$HOME/.homebrew/bin:$PATH"' >> ~/.bash_profile
获取您的个人资料以更新路径:
source ~/.bash_profile
检查Homebrew是否安装:
brew --version