OSX 10.11下Homebrew的安装问题

编程入门 行业动态 更新时间:2024-10-21 17:47:32

<a href=https://www.elefans.com/category/jswz/34/1768007.html style=OSX 10.11下Homebrew的安装问题"/>

OSX 10.11下Homebrew的安装问题

跟着官网快捷安装,出现以下报错信息:

huanghonglindeMacBook-Pro:local huanghonglin$ ruby -e "$(curl -fsSL )"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
==> The following directories will be made group writable:
/usr/local/.
==> The following directories will have their owner set to huanghonglin:
/usr/local/.
==> The following directories will have their group set to admin:
/usr/local/.Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/.
Password:
==> /usr/bin/sudo /usr/sbin/chown huanghonglin /usr/local/.
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/.
==> /usr/bin/sudo /bin/mkdir /Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown huanghonglin /Library/Caches/Homebrew
==> Downloading and installing Homebrew...
remote: Counting objects: 3798, done.
remote: Compressing objects: 100% (3638/3638), done.
remote: Total 3798 (delta 42), reused 509 (delta 24), pack-reused 0
Receiving objects: 100% (3798/3798), 3.24 MiB | 225.00 KiB/s, done.
Resolving deltas: 100% (42/42), done.
From * [new branch]      master     -> origin/master
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 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 create file share/doc/homebrew/El_Capitan_and_Homebrew.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-0.8.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Homebrew-0.9.3.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Homebrew-0.9.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Homebrew-2.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 create file 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 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 create file share/doc/homebrew/New-Maintainer-Checklist.md (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Press.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 create file share/doc/homebrew/Rename-A-Formula.md (Permission denied)
error: unable to unlink old 'share/doc/homebrew/The-brew-command.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-test-bot-failed-jenkins.png' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/brew-test-bot-failed-pr.png' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/brew-test-bot-failed-test.png' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/brew-test-bot-for-core-contributors-block.png' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/brew-test-bot-for-core-contributors-console.png' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/brew-test-bot-for-core-contributors-tabs.png' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/brew-test-bot-for-core-contributors-trigger.png' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/brew-test-bot-passed-jenkins.png' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/brew-test-bot-passed-pr.png' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/brew-test-bot-triggered-pr.png' (Permission denied)
error: unable to create file share/doc/homebrew/brew.1.html (Permission denied)
fatal: Could not reset index file to revision 'origin/master'.
Failed during: git reset --hard origin/master

解决方案:

1、先删除之前安装的homebrew:

cd `brew --prefix`
rm -rf Cellar
brew prune
rm `git ls-files`
rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions
rm -rf .git
rm -rf ~/Library/Caches/Homebrew

2、键入sudo chown -R $USER /usr/local

结果如下:

huanghonglindeMacBook-Pro:local huanghonglin$ sudo chown -R $USER /usr/local
huanghonglindeMacBook-Pro:local huanghonglin$ cd /usr/local
huanghonglindeMacBook-Pro:local huanghonglin$ ruby -e "$(curl -fsSL )"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1Press RETURN to continue or any other key to abort
==> Downloading and installing Homebrew...
remote: Counting objects: 3798, done.
remote: Compressing objects: 100% (3638/3638), done.
remote: Total 3798 (delta 42), reused 507 (delta 24), pack-reused 0
Receiving objects: 100% (3798/3798), 3.24 MiB | 12.00 KiB/s, done.
Resolving deltas: 100% (42/42), done.
From * [new branch]      master     -> origin/master
HEAD is now at dddf72f nghttp2: update 1.4.0 bottle.
==> Installation successful!
==> Next steps
Run `brew help` to get started

转载于:.html

更多推荐

OSX 10.11下Homebrew的安装问题

本文发布于:2024-02-27 05:48:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1705409.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:OSX   Homebrew

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!