我真的尝试并使用了任何建议,从修复,过度卸载,重新安装,等等,但没有任何解决方案。我完全被困住了,需要帮助才能找到解决方案!先谢谢你,克里斯托弗
MacBook-2:~ MyUserName$ brew install git
Warning: git-2.1.3 already installed, it's just not linked
MacBook-2:~ MyUserName$ brew destroy git
Error: Unknown command: destroy
MacBook-2:~ MyUserName$ brew uninstall git
Uninstalling /usr/local/Cellar/git/2.1.3...
MacBook-2:~ MyUserName$ brew install git
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/git- 2.1.3.yosemite.bottle.tar.gz
Already downloaded: /Library/Caches/Homebrew/git-2.1.3.yosemite.bottle.tar.gz
==> Pouring git-2.1.3.yosemite.bottle.tar.gz
==> Caveats
The OS X keychain credential helper has been installed to:
/usr/local/bin/git-credential-osxkeychain
The 'contrib' directory has been installed to:
/usr/local/share/git-core/contrib
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
zsh completion has been installed to:
/usr/local/share/zsh/site-functions
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink share/git-core/contrib
/usr/local/share/git-core is not writable.
You can try again using:
brew link git
==> Summary
/usr/local/Cellar/git/2.1.3: 1342 files, 32M
MacBook-2:~ MyUserName$ brew link git
Linking /usr/local/Cellar/git/2.1.3...
Error: Could not symlink share/git-core/contrib
/usr/local/share/git-core is not writable.发布于 2014-11-13 07:06:31
这可能是与权限相关的错误。
试一试
sudo chown -R $(whoami) /usr/local/share/或者,如果您只需要在git-core路径上使用它,
sudo chown -R $(whoami) /usr/local/share/git-core 可能就够了。
然后运行
brew link git再来一次。
发布于 2014-12-22 11:55:06
也许您之前使用sudo安装了一些应用程序,因此字典/usr/local/share/和/usr/local/lib的所有者变成了root
运行:
sudo chown -R $(whoami) /usr/local/share/
sudo chown -R $(whoami) /usr/local/lib然后运行:
brew link git发布于 2021-05-04 04:14:11
在更改权限之前,我会::
选项1:尝试卸载brew
1)保存brew软件包列表:
brew list > my_packages.txt2)然后是uninstall brew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"4)重新安装所有包:
brew install $(< my_packages.txt )选项2:
如果这不起作用,请尝试运行:
brew doctor使用以下命令检查是否可以删除错误:
brew prunehttps://stackoverflow.com/questions/26898269
复制相似问题