Homebrew

88次阅读

Homebrew

Homebrew官网

homebrew,mac软件包的管理器,国内源安装
网站服务:Homebrew,ai导航。
The Missing Package Manager for macOS (or Linux).

homebrew官网,mac软件包的管理器,国内源安装

什么是homebrew?

简而言之,就是一个应用市场,就好比 win 上的软件管家(不是安全管家哈,这个只有安装、删除等管理软件包的功能、官方定义的是:macOS 缺失的软件包的管理器
homebrew官网: https://brew.sh/

Homebrew国内源

  • 清华源
  • https://mirrors.tuna.tsinghua.edu.cn/help/homebrew
  • 中科大源
  • http://mirrors.ustc.edu.cn/help/brew.git.html

Homebrew 是一款自由及开放源代码的软件包管理系统,用以简化 macOS 和 linux 系统上的软件安装过程。它拥有安装、卸载、更新、查看、搜索等很多实用的功能,通过简单的一条指令,就可以实现包管理,十分方便快捷。
Homebrew 主要有四个部分组成: brewhomebrew-corehomebrew-bottleshomebrew-cask

名称 说明
brew Homebrew 源代码仓库
homebrew-core Homebrew 核心软件仓库
homebrew-bottles Homebrew 预编译二进制软件包
homebrew-cask 提供 macOS 应用和大型二进制文件

HomeBrew安装

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"


建议使用:中科院

卸载

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/HomebrewUninstall.sh)"

HomeBrew换源

中科大(建议使用、

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' >> ~/.bash_profile
source ~/.bash_profile

阿里云

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




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




echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile

清华

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


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

腾讯

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


echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.cloud.tencent.com/homebrew-bottles/bottles' >> ~/.bash_profile
source ~/.bash_profile

初始默认镜像(国外源、

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常用命令

软件搜索

brew search TEXT|/REGEX/

查看软件相关信息(显示软件的各种信息(包括版本、源码地址、依赖等等、

brew info [FORMULA|CASK...]

安装软件

brew install FORMULA|CASK...

卸载软件

brew uninstall FORMULA|CASK...

查看安装列表

brew list [FORMULA|CASK...]

查看包信息

brew info [FORMULA|CASK...]

查看哪些包可以更新

brew outdated

更新包 Homebrew 会安装新版本的包,但旧版本依然会保留

brew upgrade [FORMULA|CASK...]

brew 自身更新

brew update

清理旧版本和缓存

brew cleanup # 清理所有包的旧版本
brew cleanup [FORMULA ...] # 清理指定包的旧版本
brew cleanup -n # 查看可清理的旧版本包,不执行实际操作

锁定不想更新的包

brew pin [FORMULA ...] # 锁定某个包
brew unpin [FORMULA ...] # 取消锁定




tips:因为update会一次更新所有的包的,当我们想忽略的时候可以使用这个命令

软件服务管理

brew services list # 查看使用brew安装的服务列表
brew services run formula|--all # 启动服务(仅启动不注册、
brew services start formula|--all # 启动服务,并注册
brew services stop formula|--all # 停止服务,并取消注册
brew services restart formula|--all # 重启服务,并注册

Homebrew网址入口

https://brew.sh/

小编发现Homebrew网站非常受用户欢迎,请访问Homebrew网址入口试用。

前往AI网址导航

正文完
 0
微草录
版权声明:本站原创文章,由 微草录 2024-01-02发表,共计3618字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。