MAC必装软件之HomeBrew、HomeBrew-Cask

今天药忘吃喽~ 2023-06-06 12:05 76阅读 0赞

MAC必装软件之HomeBrew

  • 安装
  • brew命令
  • HomeBrew-cask 安装
  • HomeBrew Cask常用命令

安装

1.拉取脚本

  1. curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install

2.更改脚本中的资源链接

  1. BREW_REPO = https://github.com/Homebrew/brew“.freeze
  2. 更改为:
  3. BREW_REPO = https://mirrors.ustc.edu.cn/brew.git “.freeze
  4. 注意: 新版本HomeBrew可能没有CORE_TAP_REPO这句代码,如果没有不用新增。 如果这个镜像有问题的话,可以换成其他源。

3.执行脚本

  1. /usr/bin/ruby brew_install

4.然后把homebrew-core的镜像地址也设为中科院的国内镜像

  1. cd "$(brew --repo)"
  2. git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
  3. cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
  4. git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

5.执行更新

  1. brew update --verbose

6.检查无错误,就算完成了。

  1. brew doctor

7.直接使用 Homebrew 还需要更改默认源

  1. 替换核心软件仓库
  2. cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
  3. git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
  4. 替换 cask 软件仓库
  5. cd "$(brew --repo)"/Library/Taps/caskroom/homebrew-cask
  6. git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
  7. 替换 Bottles
  8. 1bash(默认 shell)用户:
  9. echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
  10. source ~/.bash_profile
  11. 2、用户:
  12. echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
  13. source ~/.zshrc

brew命令

1.安装

  1. brew install wget

2.查看软件包信息

  1. brew info wget

3.搜索软件

  1. brew search wget

4.更新所有软件

  1. brew update

5.卸载软件

  1. brew uninstall wget

6.更新特定软件

  1. brew upgrade wget

7.查看所有以安软件

  1. brew list

8.查看需要更新的软件

  1. brew outdated

9.现实包依赖

  1. brew reps

10.帮助

  1. brew help

HomeBrew-cask 安装

1.安装brew-cask

  1. brew install brew-cask-completion

2.检查是否安装cask

  1. brew cask

3.出现help信息表示安装成功

  1. Commands:
  2. --cache display the file used to cache the Cask
  3. audit verifies installability of Casks
  4. cat dump raw source of the given Cask to the standard output
  5. create creates the given Cask and opens it in an editor
  6. doctor checks for configuration issues
  7. edit edits the given Cask
  8. fetch downloads remote application files to local cache
  9. home opens the homepage of the given Cask
  10. info displays information about the given Cask
  11. install installs the given Cask
  12. list with no args, lists installed Casks; given installed Casks, lists staged files
  13. outdated list the outdated installed Casks
  14. reinstall reinstalls the given Cask
  15. style checks Cask style using RuboCop
  16. uninstall uninstalls the given Cask
  17. upgrade upgrades all outdated casks
  18. zap zaps all files associated with the given Cask

HomeBrew Cask常用命令

1.搜索app

  1. brew cask info qqmusic

2.安装app

  1. brew cask install qqmusic

3.app列表

  1. brew cask list

4.更新app

  1. brew cask upgrade
  2. 或者
  3. brew cask upgrade qqmusic
  4. 推荐第二种

5.卸载app

  1. brew cask uninstall qqmusic

6.了解更多操作

  1. brew cask

发表评论

表情:
评论列表 (有 0 条评论,76人围观)

还没有评论,来说两句吧...

相关阅读