46
24

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Cloud9にHomebrewをインストールする手順

Last updated at Posted at 2019-05-01

Macにパッケージをインストールする時に使うHomebrewですが、2019/2/2のリリース(v2.0.0)で、Linuxbrewを統合し、これによりLinux上でもサポートされるようになっていました。

Homebrew officially supports Linux and Windows 10 with Windows Subsystem for Linux (WSL). Homebrew on Linux was previously called “Linuxbrew”. You can install it in your home directory, so it does not require sudo, and use it to install software that your host distribution’s package manager does not provide. Homebrew on Linux uses its own repository for formulae: Homebrew/linuxbrew-core
引用: https://brew.sh/2019/02/02/homebrew-2.0.0/

さて、2019年4月にAWS東京リージョンに対応した「Cloud9」でHomebrewが使えると、Terraformの準備等が格段に楽になるだろうと思います。そこで、Cloud9にHomebrewをインストールして使えるようにするまでの手順を整理してみました。

1. Homebrewをインストール

コマンド1発です。rootではないユーザで実行します。

$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"

2. HomebrewにPATHを通す

1を実行すると、Terminalの最後に、PATHが通っていないと警告が表示されます。
そこで、以下コマンドを順に実行してPATHを通します。

$ test -d ~/.linuxbrew && PATH="$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin:$PATH"
$ test -d /home/linuxbrew/.linuxbrew && PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:$PATH"
$ test -r ~/.bash_profile && echo "export PATH='$(brew --prefix)/bin:$(brew --prefix)/sbin'":'"$PATH"' >>~/.bash_profile
$ echo "export PATH='$(brew --prefix)/bin:$(brew --prefix)/sbin'":'"$PATH"' >>~/.profile

3. 動作確認

新たにTerminalを開いて確認します。

$ brew
Example usage:
  brew search [TEXT|/REGEX/]
  brew info [FORMULA...]
  brew install FORMULA...
  brew update
  brew upgrade [FORMULA...]
  brew uninstall FORMULA...
  brew list [FORMULA...]

Troubleshooting:
  brew config
  brew doctor
  brew install --verbose --debug FORMULA

Contributing:
  brew create [URL [--no-fetch]]
  brew edit [FORMULA...]

Further help:
  brew commands
  brew help [COMMAND]
  man brew
  https://docs.brew.sh

簡単な手順でCloud9でもHomebrewを実行できるようになりました。

46
24
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
46
24

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?