LoginSignup
1
0

asdfでWSL+UbuntuにGoをインストール

Posted at

はじめに

以前インストールしたプログラミング言語管理ツールのasdfを使って、WSL UbuntuにGoをインストールします。

前提環境

asdf更新

asdfを更新します。

Ubuntu
asdf update

Goの存在確認

Ubuntu
asdf plugin list all | grep -e golang
# golang                        https://github.com/asdf-community/asdf-golang.git

asdfにGoを追加

Ubuntu
asdf plugin add golang

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

GithubのREADMEに従い依存パッケージをインストールします。

Ubuntu
sudo apt install coreutils curl

最新版Goをインストール

Ubuntu
asdf install golang latest

最新版Goをグローバルに設定

Ubuntu
asdf global golang latest

Goバージョン確認

Ubuntu
asdf current golang
# golang          1.22.0          /home/[user]/.tool-versions

go version
# go version go1.22.0 linux/amd64
1
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
1
0