LoginSignup
4
6

More than 5 years have passed since last update.

【WSL】LinuxにHomebrewを導入する

Last updated at Posted at 2019-03-18

みなさん、こんにちは。
ノンプログラマーCogome(@cogome)です。

今回はWSLのUbuntu 18.04にHomebrew(Linuxbrew)を導入した際の備忘録です。

環境

  • Edition : Windows 10 Home
  • Version : 1903
  • OS build : 18362.1 (insider preview)

初期設定

タイムゾーン

sudo dpkg-reconfigure tzdata

ミラーサーバー

/etc/apt

sudo sed -i.bak -e "s/http:\/\/archive\.ubuntu\.com/http:\/\/jp\.archive\.ubuntu\.com/g" sources.list

パーミッション設定

echo 'umask 022' >> ~/.profile
etc/wsl.conf
[automount]
options = "metadata,umask=22,fmask=11"

アップデート

sudo apt update
sudo apt upgrade

Linuxbrewをインストール

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

依存関係をインストール

==> Next steps:
- Install the Linuxbrew dependencies if you have sudo access:
Debian, Ubuntu, etc.

sudo apt-get install build-essential

環境変数を設定

test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)
test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile
echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile

パッケージをインストール

brew install hello

確認

brew doctor
cogome@DESKTOP-TTPG1CH:~$ brew doctor
Your system is ready to brew.

参考文献

4
6
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
4
6