84
50

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Ubuntuに最新のGolangをインストールする

Last updated at Posted at 2019-01-28

#Ubuntuに最新のGolangをインストールする
備忘録も兼ねて
(Ubuntu 14.04 / 16.04 / 18.04 / 20.04.01 / 22で確認済み)

追記録

2019/10/05 Ubuntu 18.04確認済みの旨追記
2020/12/21 Ubuntu 20.04.01LTS(64bit)確認済みの旨追記
2022/07/26 Ubuntu 22.04LTS(64bit)確認済みの旨追記

コメント

備忘録すぎて半年に一回くらい自分も参照しています

1. 公式のパッケージを取得する

https://golang.org/dl/ から、Linux用のtar.gzのURLをコピーする。
(2022/07/26時点では https://go.dev/dl/go1.18.4.linux-amd64.tar.gz )

$ wget https://go.dev/dl/go1.18.4.linux-amd64.tar.gz

2. 展開して配置する

$ sudo tar -C /usr/local -xzf go1.18.4.linux-amd64.tar.gz

3. goコマンドのパスを通す

$ export PATH=$PATH:/usr/local/go/bin

4. goコマンド確認

$ ubuntu@hogetan~$ go version
go version go1.18.4 linux/amd64

5. shell再起動

$ exec $SHELL -l

6. 再度goコマンド確認(パスが通っていれば使える)

$ ubuntu@hogetan~$ go version
go version go1.18.4 linux/amd64
84
50
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
84
50

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?