LoginSignup
1
0

More than 1 year has passed since last update.

Go を公式パッケージからインストール ( Ubuntu / RaspberryPi OS / WSL2 )

Last updated at Posted at 2022-05-29

インストール方法は、こちらを基にしています。
「ラズパイに Go をインストールする」
https://zenn.dev/ysmtegsr/articles/20d6e0c7159be2

環境

  • Go Version 1.18.2
  • Raspberry Pi OS Lite
    • Release date: April 4th 2022
    • System: 32-bit
    • Kernel version: 5.15
    • Debian version: 11 (bullseye)

また、同様にして Ubuntu20.04 , WSL2 にもインストールできました。

ダウンロード

https://go.dev/dl/
こちらから、該当のアーキテクチャを選択し、リンク先をコピーして使います。
image.png

  • RaspberryPi (32bit) の場合: go1.18.2.linux-armv6l.tar.gz
  • Ubuntu 20.04 (AMD64) および WSL2 の場合: go1.18.2.linux-amd64.tar.gz

$ wget https://go.dev/dl/go1.18.2.linux-armv6l.tar.gz

インストール


$ sudo tar -C /usr/local -xzf go1.18.2.linux-armv6l.tar.gz 

パスを通します

$ echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
$ echo 'export PATH=$HOME/go/bin:$PATH' >> ~/.bashrc

パスを反映しておきます


$ source ~/.bashrc

動作確認


$ go version
go version go1.18.2 linux/arm

うまく動いているようです

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