6
7

More than 5 years have passed since last update.

Homebrewでパッケージをインストールする際の3つの手段

Posted at

1. 普通にパッケージをインストール

例)wgetをインストールする

$ brew install wget

2. dmg(pkg?)をcaskでインストールする

例)docker for macをインストールする

$ brew cask install docker

3. mas-cliを使用して、AppStoreからインストールする

・mas-cli: Mac App Store command line interface
https://github.com/mas-cli/mas

$ brew install mas      # mas-cliのインストール
$ mas install 497799835 # xcode(IDで指定)

mas install XXXXXXの数値はアプリごとのIDで、itunes.apple.comのアプリのURLにidXXXXXとあるのでそれを。

例)Xcode
https://itunes.apple.com/jp/app/xcode/id497799835?mt=12

番外

シェルスクリプトにまとめると楽かも?

#!/bin/sh

echo "Homebrewのインストール(※コマンドが変わることがあるので注意)"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

echo "brew診断"
brew doctor

echo "⇒Your system is ready to brewって出たら成功です"

# ①そのままパターン
brew install wget

# ②caskパターン
brew cask install docker

# ③mas-cliパターン
mas install 497799835 # xcode(IDで指定)
6
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
7