zoukankan      html  css  js  c++  java
  • Mac brew 配置&操作


    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或~/.zshrc
    HOMEBREW_BOTTLE_DOMAIN 进行注释


    查找软件 brew search software
    安装软件 brew install php
    安装指定版本 brew install php@7.4

    卸载 brew uninstall php

    启动php@7.4 brew services start php@7.4

    vim ~/.zshrc
    环境变量写入 export PATH="$HOME/.composer/vendor/bin:$PATH" // $HOME代表 ~

  • 相关阅读:
    base -2 Number——进制转换
    AtCoder Crackers——水题
    血色先锋队——bfs
    Atcoder---ID排序模拟结构体
    101. 对称二叉树
    100. 相同的树
    95. 不同的二叉搜索树 II
    96. 不同的二叉搜索树
    JavaWeb学习总结(五十)——文件上传和下载(转载)
    145. 二叉树的后序遍历
  • 原文地址:https://www.cnblogs.com/blue-t/p/14495652.html
Copyright © 2011-2022 走看看