0
0

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 1 year has passed since last update.

WSL2 に homebrew をインストールする

Posted at

過去、会社のPCと自宅PCにぞれぞれ2回インストールしてますが、今日またインストールすることになりました

毎回公式サイト見ながらやっていたのですが、微妙に時間掛かるのでいい加減に手順をまとめて残しておこうかと思いメモ

日本語公式サイト

インストール前準備

homebrew を動かすのに必要なもの

  • Linux 3.2 or newer
  • Glibc 2.13 or newer
  • 64-bit x86_64 CPU

下記コマンドを実行

sudo apt-get upgrade
sudo apt-get update
sudo apt-get install build-essential procps curl file git

参考ページ

インストール

日本語公式サイトのこちらに載っているコマンドをコピーして実行

スクリーンショット 2024-04-17 193205.png

コマンド

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.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; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /home/kazumacchi/.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 を利用できません
パスの通し方もインストール時に教えてもらえます

Next Steps の箇所に、パスを通すのにコマンドが表示されています

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

Run these two commands in your terminal to add Homebrew to your PATH: の下の2つのコマンドを実行します

上記のコマンドは僕の環境で表示されたコマンドのため、他の方は利用できません
自身のターミナルに表示されたコマンドを実行してください

ターミナルを再起動して homebrew バージョンを確認

正常に表示されればOK

brew --version

お疲れ様でした

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?