🐡

ubuntuにHomebrewをインストール

2022/06/13に公開約1,600字

はじめに

ubuntuにHomebrewをインストールしたので、そのメモを残します。

手順

aptで必要なものをインストールしていきます。

apt-get install build-essential procps curl file git

次に公式からHomebrewをインストールするコマンドを入力します。

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

https://brew.sh/

インストールが完了すると下記のメッセージが出るので、

==> 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 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/aiuser/.profile
    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

「Next steps」の内容を入力して実行。(/home/aiuser/.profileは各自の指定path)

echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/aiuser/.profile
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
sudo apt-get install build-essential
brew install gcc

バージョンを確認して、pathが通っている確認。

brew --version
Homebrew 3.5.1
Homebrew/homebrew-core (git revision b494438e65c; last commit 2022-06-13)

Discussion

ログインするとコメントできます