zoukankan      html  css  js  c++  java
  • mac安装brew及修改brew源

    brew 又叫Homebrew,是Mac OSX上的软件包管理工具,能在Mac中方便的安装软件或者卸载软件, 只需要一个命令, 非常方便

    brew类似ubuntu系统下的apt-get的功能

    安装brew

    brew 的官方网站: http://brew.sh/   在官方网站对brew的用法进行了详细的描述

    安装方法:  在Mac中打开Termal:  输入命令:

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

    使用brew安装软件

    一个命令就搞定了

    安装git
    # brew install git
    安装wget
    # brew install wget
    使用brew卸载软件
    # brew uninstall wget
    使用brew查询软件
    比如查询wget
    # brew search /wge*/  : /wge*/是个正则表达式, 需要包含在/中
    其他brew命令
    # brew list       //列出已安装的软件
    # brew update     //更新brew
    # brew home       //用浏览器打开brew的官方网站
    # brew info       //显示软件信息
    # brew deps       //显示包依赖

    brew源改成清华的源

    # git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
    # git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
    # git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
    # brew update

    brew源改成aliyun的源

    # git -C "$(brew --repo)" remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
    # git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
    # git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.aliyun.com/git/homebrew/homebrew-cask.git # brew update

    如果想还原brew源

    # git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git
    # git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git
    # git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask.git
    # brew update
  • 相关阅读:
    阿里巴巴JAVA开发手册
    2018开源中国最受欢迎的中国软件
    Java并发编程(多线程)中的相关概念
    关于HashMap自定义key重写hashCode和equals的问题
    MySQL视图 索引 存储过程 触发器 函数
    MySql/Oracle树形结构查询
    码农也来关注下经济问题<美元加息>对我们的影响
    不懂技术却能做到月入20万美元,差距在哪里
    solidity智能合约如何判断mapping值为空
    微信很好用却很少人知道的浮窗功能
  • 原文地址:https://www.cnblogs.com/ckh2014/p/14239573.html
Copyright © 2011-2022 走看看