LoginSignup
3
1

はじめに

Ubuntu環境でHomebrewをインストールする方法を作成します。

環境

Ubuntu 22.04 LTS

Homebrewインストール

Homebrewのインストール手順は以下のようになります。

  1. コマンドを実行してHomebrewをインストール
  2. 追加コマンドを実行
  3. Homebrewの実行を確認

コマンドを実行してHomebrewをインストール

Homebrewの公式サイトにインストールのコマンドが書いています。
そのコマンドをターミナルで入力して実行します。

公式で書いているコマンドは以下のようになっています。

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

追加コマンドを実行

インストールが完了すると、以下のようなメッセージが表示されます。
「Next steps」の部分のコマンドを実行します。

{ユーザー名}の部分には、自分のユーザー名が入っています。

==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics
No analytics data has been sent yet (nor will any be during this install run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations

==> Next steps:
- Run these two commands in your terminal to add Homebrew to your PATH:
    (echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /home/{ユーザー名}/.bashrc
    eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
- Install Homebrew's dependencies if you have sudo access:
    sudo apt-get install build-essential
  For more information, see:
    https://docs.brew.sh/Homebrew-on-Linux
- We recommend that you install GCC:
    brew install gcc
- Run brew help to get started
- Further documentation:
    https://docs.brew.sh

Homebrewの実行を確認

Homebrewが実行できるか確認します。

$ brew --version
Homebrew 4.3.5
3
1
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
3
1