Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
6
Help us understand the problem. What is going on with this article?

More than 1 year has passed since last update.

@cogome

【WSL】LinuxにHomebrewを導入する

みなさん、こんにちは。
ノンプログラマー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.

参考文献

6
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
6
Help us understand the problem. What is going on with this article?