LoginSignup
0
0

More than 5 years have passed since last update.

さくらVPS(CentOS)にGoの1.10系をインストールしてみた。

Last updated at Posted at 2018-08-07

さくらVPS使ってて、Goを試してみたいなと思ったところ、最新版が入らず少し苦労したので、記事に記します。

Goのインストール

$ yum update
$ yum install golang

この場合、簡単にGoをインストールできるのですが、なぜか1.9系が入ってきてしまい、1.10系が使えません。

今回はライブラリの依存関係で1.10が必要だったために、この方法をあきらめます。

一度入れてしまってじゃまなGoは消しておきます。

$ yum remove golang

最新版のGoをインストールする

記事執筆時点でCentOS上で動くものは以下なので、
https://storage.googleapis.com/golang/go1.10rc2.linux-arm64.tar.gz

これをwgetで持ってきます。

$ cd /usr/local/src
$ wget https://storage.googleapis.com/golang/go1.10rc2.linux-arm64.tar.gz

その後、ファイルを/usr/local配下に解凍しておきます。

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

Goのパスを通します。

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

出来上がり。
簡単なことをちょっと手間取ってしまいました。

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