• OSX 10.11下Homebrew的安装问题


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

    huanghonglindeMacBook-Pro:local huanghonglin$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    ==> 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 https://github.com/Homebrew/homebrew
     * [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 https://raw.githubusercontent.com/Homebrew/install/master/install)"
    ==> This script will install:
    /usr/local/bin/brew
    /usr/local/Library/...
    /usr/local/share/man/man1/brew.1
    
    Press 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 https://github.com/Homebrew/homebrew
     * [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
  • 相关阅读:
    jquery新知识
    jquery回顾
    Filter和Listener
    jsp,jstl,el
    cookie和session
    servlet和HTTP原理
    xml基本知识
    linux 相关操作
    linux mysql 相关操作、问题
    linux 文件结构
  • 原文地址:https://www.cnblogs.com/S-yesir/p/4911513.html
Copyright © 2020-2023  润新知