美文网首页
安装HomeBrew

安装HomeBrew

作者: 守护地中海的花 | 来源:发表于2021-03-15 11:16 被阅读0次

    难受 想哭😿 为了解决某个东西 发现homebrew特别难搞

    查看你的mac是否安装了homebrew

    brew -v
    -bash: brew: command not found
    
    查看版本:brew -v
    安装软件:brew install 软件名
    搜索软件:brew search 软件名
    卸载软件:brew uninstall 软件名
    更新所有软件:brew update
    更新具体软件:brew upgrade 软件名
    显示已安装软件:brew list
    查看哪些已安装的程序需要更新: brew outdated
    显示包依赖:brew reps
    显示帮助:brew help
    

    安装

    • 获取脚本 点击 需要vpn 不然打不开该网址
      官网 复制下面执行语句会报错 所有还是乖乖下载sh到本地把
      image.png
      点击上面的连接然后打开vpn
      image.png
      复制网页内所有内容哦 保存脚本到桌面上
      image.png
    • 执行
      打开vpn执行下面命令 不然没啥反应
    bash /Users/mac/Desktop/brew_install.sh 
    

    执行结果

    macpro15:~ mac$ bash /Users/mac/Desktop/brew_install.sh 
    Password:
    ==> This script will install:
    /usr/local/bin/brew
    /usr/local/share/doc/homebrew
    /usr/local/share/man/man1/brew.1
    /usr/local/share/zsh/site-functions/_brew
    /usr/local/etc/bash_completion.d/brew
    /usr/local/Homebrew
    
    Press RETURN to continue or any other key to abort
    ==> /usr/bin/sudo /usr/sbin/chown -R mac:admin /usr/local/Homebrew
    ==> Downloading and installing Homebrew...
    remote: Enumerating objects: 44, done.
    remote: Counting objects: 100% (44/44), done.
    remote: Compressing objects: 100% (44/44), done.
    error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
    fatal: the remote end hung up unexpectedly
    fatal: early EOF
    fatal: index-pack failed
    Failed during: git fetch --force origin
    

    之间看我下面的解决方案把

    • 替换资源链接
      全文搜索 带双引号搜索
    "https://github.com/Homebrew/brew"
    "https://github.com/Homebrew/homebrew-core"
    

    替换成

    "https://mirrors.ustc.edu.cn/brew.git"
    "https://mirrors.ustc.edu.cn/homebrew-core.git"
    

    执行 一定要关闭vpn 不然太慢了而且会失败 、关闭vpn、关闭vpn、关闭vpn、关闭vpn、关闭vpn、关闭vpn

    bash /Users/mac/Desktop/brew_install.sh 
    
    image.png
    image.png
    • 终于安装好了
      这个时候可以看看版本了

    相关文章

      网友评论

          本文标题:安装HomeBrew

          本文链接:https://www.haomeiwen.com/subject/npfkcltx.html