尝试在我的Mac系统(HighSiera10.13.3)上更新git
brew install git给出了输出
$ brew install git
==> Downloading https://homebrew.bintray.com/bottles/git-2.16.2.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring git-2.16.2.high_sierra.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink share/man/man5/gitattributes.5
/usr/local/share/man/man5 is not writable.
You can try again using:
brew link git
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
zsh completions and functions have been installed to:
/usr/local/share/zsh/site-functions
Emacs Lisp files have been installed to:
/usr/local/share/emacs/site-lisp/git
==> Summary
/usr/local/Cellar/git/2.16.2: 1,496 files, 34.5MB但是,您可以看到它与brew link步骤有问题。试图通过运行
brew link git
brew link --overwrite git
brew link --force git给出同样的错误
Linking /usr/local/Cellar/git/2.16.2...
Error: Could not symlink share/man/man5/gitattributes.5
/usr/local/share/man/man5 is not writable.有人也经历过并设法修复了它吗?
Mac的用户和组

输出

发布于 2018-02-28 21:23:28
您必须使用以下方法修复权限:
sudo chown -R "$USER":admin /usr/local
sudo chown -R "$USER":admin /Library/Caches/Homebrew如果你是系统上唯一的自制用户,它就能很好地工作。如果第三方工具正在等待/usr/local上的其他权限,则可能会造成问题。但是,我多年来一直使用这个设置,没有问题。详情请参见如何修正自制的权限?。
但为此您必须具有管理计算机的权限。在“系统首选项”中的“用户和组”中,应选中“允许用户管理此计算机”复选框。
发布于 2018-07-05 19:57:25
如果您在高塞拉利昂,/usr/local是不可写的(可能是由于啜饮的变化),但内容是。因此,您只需修改另一个答案中的命令,就可以只针对以下目录:
sudo chown -R "$USER":admin /usr/local/*
sudo chown -R "$USER":admin /Library/Caches/Homebrew/*https://stackoverflow.com/questions/49014472
复制相似问题