LoginSignup
7
7

More than 5 years have passed since last update.

Amazon LinuxでGolangの設定してみるメモ

Posted at

AWS EC2でAmazon LinuxにSSH接続している前提です。

yumに登録されているか探す

$ sudo yum list go*
読み込んだプラグイン:priorities, update-motd, upgrade-helper
利用可能なパッケージ
golang.x86_64                                        1.4.2-2.12.amzn1                                 @amzn-updates
golang-pkg-bin-linux-amd64.x86_64                    1.4.2-2.12.amzn1                                 @amzn-updates
golang-pkg-linux-amd64.noarch                        1.4.2-2.12.amzn1                                 @amzn-updates
golang-src.noarch                                    1.4.2-2.12.amzn1                                 @amzn-updates
・
・
・

あるみたいですね。

Golangのインストール

$ sudo yum install -y golang

確認

$ go version
go version go1.4.2 linux/amd64

v1.4.2が入りました。

GOPATH設定

Mac YosemiteにGoのインストールからghq+pecoを使うまでを参考に

.bash_profile.zshrcなどに追記

$ vim ~/.bash_profile
~/.bash_profile
 ### GO PATHを追加
 export GOPATH=$HOME/.go
 export PATH=$HOME/.go/bin:$PATH

変更を適用させます。

$ source ~/.bash_profile
7
7
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
7
7