解决Mac OSX系统版本安装brew出错

解决Mac OSX系统版本安装brew出错

字数837  阅读780  评论2 

上周更新了最新的Mac OSX操作系统10.11.x,但是安装brew命令的时候出现如下两种错误:

fatal: cannot unlink 'Library/Aliases/0install': Permission denied
error: unable to unlink old 'share/doc/homebrew/Acceptable-Formulae.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Bottles.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Brew-Test-Bot-For-Core-Contributors.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Brew-Test-Bot.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/C++-Standard-Libraries.md' (Permission denied)
error: unable to create file share/doc/homebrew/Checksum_Deprecation.md (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Common-Issues-for-Core-Contributors.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Common-Issues.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Custom-GCC-and-cross-compilers.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/External-Commands.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/FAQ.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Formula-Cookbook.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Gems,-Eggs-and-Perl-Modules.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Homebrew-and-Python.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/How-to-Create-and-Maintain-a-Tap.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/How-to-build-software-outside-Homebrew-with-Homebrew-keg-only-dependencies.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Installation.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Interesting-Taps-&-Branches.md' (Permission denied)
error: unable to create file share/doc/homebrew/Kickstarter-Supporters.md (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Maintainer-Guidelines.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Migrating-A-Formula-To-A-Tap.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/New-Maintainer-Checklist.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Python-for-Formula-Authors.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Querying-Brew.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/README.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Rename-A-Formula.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Tips-N'-Tricks.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Troubleshooting.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Xcode.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/brew-tap.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/brew.1.html' (Permission denied)
fatal: cannot create directory at 'share/doc/homebrew/images': Permission denied

网上找了半天找到了此种方法stackoverflow.此方法给我了一些提示,解决了OSX系统中brew的安装。

1.clone brew项目到本地
git clone https://github.com/Homebrew/brew
2.移动项目文件

在执行文件的移动之前,请保证要移动到的目录文件中的相同文件移除

1).通过本地项目可知brew的目录结构,而我们所使用的命令都是/usr/local/bin文件中,因此将brew中的bin目录下的命令brew拷贝或者移动到/usr/local/bin下:(我所使用的是移动)
//进入本地项目brew中
cd brew 
//移动brew到系统文件中
sudo mv bin/brew /usr/local/bin
2).移动Library
//移动Library库到/usr/local
sudo Library /usr/local
3).移动share文件
//移动share库到/usr/local
sudo mv share /usr/local
3.查看是否安装成功

使用brew查看是否已经移动成功.如果有以下内容则代表成功。



到此为止,我们可以运行brew update更新brew,以及brew install来安装我们所要使用的工具

ps:转载请注明出处

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值