• homebrew安装和解决brew安装速度慢的问题


    homebrew安装

    ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
    

    解决brew安装速度慢的问题(替换homebrew镜像源)

    1.替换brew.git:

    cd "$(brew --repo)”
    git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
    

    2.替换homebrew-core.git:

    cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
    git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
    

    3.终端输入命令:

    echo $SHELL 看输出结果是/bin/zsh还是/bin/bash

    • /bin/zsh替换homebrew-bottles:
    echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
    source ~/.zshrc
    
    • /bin/bash替换homebrew-bottles:
    echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
    source ~/.bash_profile
    

    4.恢复homebrew国内镜像源配置

    • 重置brew.git
    cd "$(brew --repo)"
    git remote set-url origin https://github.com/Homebrew/brew.git
    
    • 重置homebrew-core.git
    cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
    git remote set-url origin https://github.com/Homebrew/homebrew-core.git
    
    • 重置homebrew-bottles
    将刚添加到~/.bash_profile文件的语句注释掉即可
    

    解决brew安装包一直卡在Updating Homebrew

    运行命令brew install node,结果界面一直卡在Updating Homebrew上,有两种解决办法

    方法一:关闭brew每次执行命令时的自动更新(推荐)

    vim ~/.bash_profile
    # 新增一行
    export HOMEBREW_NO_AUTO_UPDATE=true
    

    方法二(懒人方法):

    出现Updating Homebrew的时候ctrl+c一下就行
    
  • 相关阅读:
    第4章:kubectl命令行管理工具
    Docker_CICD笔记
    Harbor镜像仓库
    centos7 安装最新的 wiki confluence
    Centos7.5使用SSH密钥登录
    一篇文章带你搞懂 etcd 3.5 的核心特性
    腾讯云边缘容器 TKE Edge 国内首批通过边缘容器技术能力认证
    揭秘有状态服务上 Kubernetes 的核心技术
    腾讯云云原生混合云-TKE发行版
    kubernetes 降本增效标准指南|理解弹性,应用弹性
  • 原文地址:https://www.cnblogs.com/trotl/p/11862796.html
Copyright © 2020-2023  润新知