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
    

  • 相关阅读:
    IBM项目(项目管理)
    MSN附加照片问题解决
    国家图书馆新馆
    『Python Kivy』Kivy and PyDev on Eclipse
    『C#基础』C#导出Excel
    『Python Kivy』什么是Kivy,以及Hello world
    『创建型』简单工厂SimpleFactory、工厂方法FactoryMethod、抽象工厂AbstractFactory
    『C#基础』多线程笔记「三」计时器
    『C#基础』多线程笔记「二」线程同步
    『创建型』单例模式Singleton学习笔记
  • 原文地址:https://www.cnblogs.com/shine-lovely/p/15078914.html
Copyright © 2011-2022 走看看