尝试使用
在我的Mac系统(High Sierra 10.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的用户和群组
输出
答案 0 :(得分:3)
如果您在High Sierra上,Arraylist
是不可写的(可能是由于SIP的更改),但是内容是可写的。因此,您只需要修改其他答案中的命令即可仅将目标放在以下目录中:
Integer [] ia = {1,2,3,4};
System.out.println("Array : "+Arrays.toString(ia));
List<Integer> list1 = new ArrayList<Integer>(Arrays.asList(ia)); // new ArrayList object is created , no connection between existing Array Object
list1.add(5);
list1.add(6);
list1.remove(0);
list1.remove(0);
System.out.println("list1 : "+list1);
System.out.println("Array : "+Arrays.toString(ia));
答案 1 :(得分:2)
您必须使用以下命令修复权限:
sudo chown -R "$USER":admin /usr/local
sudo chown -R "$USER":admin /Library/Caches/Homebrew
如果您是系统中唯一的自制用户,那么效果很好。如果第三方工具正在等待/usr/local
上的其他权限,则可能会导致问题。但是,我使用这些设置多年没有问题。有关详细信息,请参阅How to fix homebrew permissions?。
但为此,您必须有权管理计算机。在“系统偏好设置”中 - &gt;用户&amp;群组,您的用户应选中“允许用户管理此计算机”复选框。