LoginSignup
0
0

More than 1 year has passed since last update.

Windows10 Home + WSL2環境にLinuxbrewをインストールする方法

Last updated at Posted at 2021-10-15

はじめに

  • Windows10 Home + WSL2環境にLinuxbrewをインストールする方法をまとめました

実行環境

  • Windows10 Home 64bit
  • Build Version: 19624.1000
    • Windows Insider Programにより通常のビルドより新しいものとなっている
  • WSL (Windows Subsystem for Linux) :2
    • LinuxOS:Ubuntu18.04

インストールするもの

Linuxbrew

  1. 事前にインストールするもの
$ sudo apt install build-essential curl file git
  1. Linuxbrewのインストール
$ sudo apt install build-essential curl file git
  • 記述されたとおりに進める
  1. パスを通す
$ echo 'eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)' >>~/.profile
$ eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
  1. gccのインストール
$ brew install gcc
  • 依存関係のあるものもDLされる

    • patchelfzlibgmpmpfrlibmpcisl@0.18など
  • ここでエラーが出た

Error: patchelf must be installed: brew install patchelf
Warning: Bottle installation failed: building from source.
Error: The following formula
    patchelf
cannot be installed as binary package and must be built from source.
Install Clang or run `brew install gcc`.
  • gccをインストールするためにpatchelfが必要だからインストール
    しようとしてるけどClang or gccが必要 → gccClang が入ってないので patchelf のソースがビルドできない

    • 対応
      • clangのインストール
$ sudo apt update
$ sudo apt install clang
  1. brewが正常に動作するか確認
$ brew doctor
  1. 完了
Your system is ready to brew.

おまけ

  • patchelf - PatchELFのこと
  • ELF

    • Executable and Linkable Format の略
    • Linux や Unix で使われるファイルの実行形式の事(.binとか.exeみたいなもの)
  • gcc

    • GNU Compiler Collection の略
    • 色々な言語に対応したコンパイラ(JavaやGoも読める)
    • GNUの読みはぐぬーらしい
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