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?

GoをUbuntu(WSL)にインストールする

Posted at

はじめに

Linuxを使ってみたくなったので、WSLにもGoをインストールします。

インストール

基本的には公式ドキュメントに従っていきます。

1. 圧縮ファイルをダウンロードします。

username@MACHINENAME:~$ wget https://go.dev/dl/go1.24.1.linux-amd64.tar.gz

2. 既に古いバージョンをインストールしている場合はrm -rf /usr/local/goで消します。
3. 解凍します。

username@MACHINENAME:~$ tar -xzf go1.24.1.linux-amd64.tar.gz

公式ドキュメントでは-C /usr/localをつけて直接localに展開してましたが、その通りにやると下のようなエラーが出ました。

...
go/test: Cannot mkdir: No such file or directory
tar: go/test/zerosize.go: Cannot open: No such file or directory
tar: Exiting with failure status due to previous errors

ので、その場に展開してから移動させます。

username@MACHINENAME:~$ sudo mv go /usr/local/go

インストールできました。

username@MACHINENAME:~$ go version
go version go1.24.1 linux/amd64
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?