zoukankan      html  css  js  c++  java
  • Homebrew

    homebrew

    更多more

    Homebrew是一款包管理工具,主要由④ 部分组成:brew、homebrew-core、homebrew-cask、homebrew-bottles

    名称 说明
    brew Homebrew 源代码仓库
    homebrew-core Homebrew 核心源
    homebrew-cask 提供 macOS 应用和大型二进制文件的安装
    homebrew-bottles 预编译二进制软件包

    安装homebrew

    脚本内置中科大的镜像源

    /bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install.sh)"
    
    • 如果命令卡在下面信息

      ==> Tapping homebrew/core
      Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
      

      或者查看/usr/local/Homebrew/Library/Taps/homebrew下面没有homebrew-core文件夹, 手动克隆

      cd "$(brew --repo)/Library/Taps/"
      mkdir homebrew && cd homebrew
      git clone git://mirrors.ustc.edu.cn/homebrew-core.git
      
    • 安装cask 同样也有安装失败或者卡住的问题,解决方法也是一样:

      cd "$(brew --repo)/Library/Taps/"
      cd homebrew
      git clone https://mirrors.ustc.edu.cn/homebrew-cask.git
      
    • 成功执行之后继续执行安装命令。

      最后看到==> Installation successful!就说明安装成功了。

      最最后更新下:

      brew update
      

    查看当前源

    • brew源

      cd "$(brew --repo)" && git remote -v
      
    • homebrew-core

      cd "$(brew --repo homebrew/core)" && git remote -v
      
    • home-bottles

      查看Mac终端shell类型是bash还是zsh

      echo $SHELL
      >  /bin/bash  # bash
      >  /bin/zsh   # zsh
      

      切换shell类型

      • 切换到bash:chsh -s /bin/bash
      • 切换到zsh:chsh -s /bin/zsh
    • home-cash

      cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask" && git remote -v
      

    换源

    git -C "$(brew --repo)" remote set-url origin https://mirrors.ustc.edu.cn/brew.git
    git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
    git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
    brew update
    
    echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles/bottles' >> ~/.zprofile
    source ~/.zprofile
    

  • 相关阅读:
    cf 786B. Legacy(线段树区间建图)
    cf 1416D. Graph and Queries (生成树重构+线段树维护dfs序)
    cf 1437E. Make It Increasing
    cf 1434D. Roads and Ramen (树上最长偶权链)
    cf 1413C (贪心排序+双指针)
    cf 1421E. Swedish Heroes (dp)
    CF1428 F.Fruit Sequences
    11.Redis详解(十一)------ 过期删除策略和内存淘汰策略
    10.Redis详解(十)------ 集群模式详解
    9.Redis详解(九)------ 哨兵(Sentinel)模式详解
  • 原文地址:https://www.cnblogs.com/shine-lovely/p/15078914.html
Copyright © 2011-2022 走看看