zoukankan      html  css  js  c++  java
  • 【开发笔记】-Mac下HomeBrew 更新源失败问题

    1、brew update 卡死问题
    (1)依次替换以下brew源

    #更新Homebrew
    cd "$(brew --repo)"
    git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
    
    #更新Homebrew-core
    cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
    git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
    
    #更新Homebrew-cask(最重要的一步,很多更新完国内源依然卡就是没更新这个)
    cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask
    git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git

    ps:如果没有homebrew-cask这个目录可以找到/usr/local/Library……下的相关目录自己创建一个即可。

    (2)选择zsh或bash用户,执行即可
    zsh用户

    echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles/' >> ~/.zshrc
    source ~/.zshrc

    bash用户

    echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles/' >> ~/.bash_profile
    source ~/.bash_profile


    (3)择一命令,更新brew

    brew update -v  
    
    or
    brew update
    -reset
    2. brew install 总是显示 No similarly named formulae found.问题
    git -C $(brew --repository homebrew/core) checkout master
    or
    git -C $(brew --repository homebrew/core) reset --hard HEAD.

     3. Mac报错:Error: The following directories are not writable by your user: /usr/local/share/man/man8 解决方案

    首先打开终端,然后输入:

    sudo chown -R `whoami`:admin /usr/local/bin

    接着系统会提醒你输入密码,输入密码回车之后接着输入:

    sudo chown -R `whoami`:admin /usr/local/share

    之后就能在终端中用brew install 安装文件了

    ps:如果还是报错的话,将3的命令中 /usr/local 后的目录换成报错的目录,再次执行即可。

     
  • 相关阅读:
    Android入门第六篇之ListView (一)
    STL 二分查找三兄弟(lower_bound(),upper_bound(),binary_search())
    fastjson 之常见的数据类型与json的相互转换
    Jetty:配置安全
    xml文件格式例如以下
    《编程珠玑》---笔记。浏览此文,一窥此书。
    【Github教程】史上最全github用法:github入门到精通
    SSL连接建立过程分析(1)
    ant 安装
    GMM的EM算法实现
  • 原文地址:https://www.cnblogs.com/juihai/p/14921753.html
Copyright © 2011-2022 走看看