LoginSignup
3
0

More than 5 years have passed since last update.

Ubuntu に Go をインストール (公式サイトからバイナリダウンロード)

Last updated at Posted at 2017-12-06

Windows Subsystem for Linux 上の Ubuntu に Go をインストールする方法。 https://golang.org/dl/ からバイナリをダウンロードして、/opt 下に展開する。

ドキュメントは https://golang.org/doc/install にある。 ドキュメントでは /usr/local/go 下にパッケージを展開するということになっていて、FHS 的には非推奨な感じなので (ですよね?)、/opt 下にインストールすることにした。

cd /opt
sudo wget https://redirector.gvt1.com/edgedl/go/go1.9.2.linux-amd64.tar.gz
sudo tar -C /opt -xzf go1.9.2.linux-amd64.tar.gz

あとは /etc/profile に下記の内容を追加。

export GOROOT=/opt/go
export PATH=$PATH:$GOROOT/bin

こんな感じ。

参考

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