美文网首页
Mac 下可能是最好的包安装器 - Homebrew

Mac 下可能是最好的包安装器 - Homebrew

作者: acc8226 | 来源:发表于2021-01-18 22:32 被阅读0次

    软件安装器 Homebrew

    Homebrew 安装

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

    Homebrew 源替换

    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
    

    还原 homebrew 源

    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
    

    Homebrew-bottles 镜像使用帮助

    注:该镜像是 Homebrew 二进制预编译包的镜像。本镜像站同时提供 Homebrew 的 formula 索引的镜像(即 brew update 时所更新内容),请参考 Homebrew 镜像使用帮助。**

    临时替换

    export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles
    

    长期替换

    echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
    source ~/.bash_profile
    

    brew 的常用命令
    搜索

    $ brew search tomcat
    

    安装软件

    $ brew install wget
    $ brew install nginx
    $ brew install redis
    

    Homebrew 镜像使用帮助 https://mirror.tuna.tsinghua.edu.cn/help/homebrew/

    相关文章

      网友评论

          本文标题:Mac 下可能是最好的包安装器 - Homebrew

          本文链接:https://www.haomeiwen.com/subject/tlsfzktx.html