首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法符号链接共享/git-core/contrib /usr/local/share/git-core不可写

无法符号链接共享/git-core/contrib /usr/local/share/git-core不可写
EN

Stack Overflow用户
提问于 2014-11-13 06:56:57
回答 3查看 7.5K关注 0票数 13

我真的尝试并使用了任何建议,从修复,过度卸载,重新安装,等等,但没有任何解决方案。我完全被困住了,需要帮助才能找到解决方案!先谢谢你,克里斯托弗

代码语言:javascript
复制
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.
EN

回答 3

Stack Overflow用户

发布于 2014-11-13 07:06:31

这可能是与权限相关的错误。

试一试

代码语言:javascript
复制
sudo chown -R $(whoami) /usr/local/share/

或者,如果您只需要在git-core路径上使用它,

代码语言:javascript
复制
sudo chown -R $(whoami) /usr/local/share/git-core 

可能就够了。

然后运行

代码语言:javascript
复制
brew link git

再来一次。

票数 29
EN

Stack Overflow用户

发布于 2014-12-22 11:55:06

也许您之前使用sudo安装了一些应用程序,因此字典/usr/local/share//usr/local/lib的所有者变成了root

运行:

代码语言:javascript
复制
sudo chown -R $(whoami) /usr/local/share/

sudo chown -R $(whoami) /usr/local/lib

然后运行:

代码语言:javascript
复制
brew link git
票数 13
EN

Stack Overflow用户

发布于 2021-05-04 04:14:11

在更改权限之前,我会:

选项1:尝试卸载brew

1)保存brew软件包列表:

代码语言:javascript
复制
brew list > my_packages.txt

2)然后是uninstall brew

代码语言:javascript
复制
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

3) Re-install brew

代码语言:javascript
复制
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

4)重新安装所有包:

代码语言:javascript
复制
brew install $(< my_packages.txt )

选项2:

如果这不起作用,请尝试运行:

代码语言:javascript
复制
brew doctor

使用以下命令检查是否可以删除错误:

代码语言:javascript
复制
brew prune

Reference

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26898269

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档