zoukankan      html  css  js  c++  java
  • FAQ- Homebrew update error not work on OSX

    brew update 错误是这样的

    chown: /usr/local: Operation not permitted

    然后网上osx 10.11, 10.12的解决方法这样的

    The problem mainly occurs after updating OS X to El Capitan (OS X 10.11) or macOS Sierra (macOS 10.12). This is mainly because of file permission issues with El Capitan’s or later macOS's new SIP process. Try changing permissions of /usr/local directory.
    $ sudo chown -R $(whoami):admin /usr/local 
    If it still doesn't work, use following steps and everything will be fine. This may be because homebrew is not updated.
    1. open terminal 
    2. $ cd /usr/local/Library/Homebrew 
    3. $ git reset --hard 
    4. $ git clean -df
    5. $ brew update

    10.13之后库克怒了,不管你怎么执行命令都不让你运行 哪怕是root ,所以有人这么干:

    看来只有关掉SIP了
    
    1.重启Mac,按住Command + R键直到Apple Logo出现,进入Recovery Mode模式(我感觉我是按了好半天)
    
    2.点击工具里的Terminal(终端)
    
    3.输入csrutil disable,之后回车
    
    4.重启Mac
    
    5.重启完成后,终端中输入 sudo chflags norestricted /usr/local && sudo chown -R $(whoami):admin /usr/local
    
    成功执行,没有报操作不允许了
    
    (如果想重新开启安全设置,则重复1、2步骤,输入csrutil enable就可以了)

    然而根本没这么麻烦 这样就可以搞定 OS X 10.13 brew not work (简单的说就是卸载了再安装)

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)”
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • 相关阅读:
    find命令详解
    wget命令
    国内镜像源
    向linux服务器上传下载文件方式收集
    一些初学shell自己写的一些练习题脚本
    在Linux系统下mail命令的用法
    MAC 下安装 SVN
    天气预报api整理
    pdi vcard-2.1
    Android Studio 问题锦集【持续更新】
  • 原文地址:https://www.cnblogs.com/Joker_/p/8776456.html
Copyright © 2011-2022 走看看