Skip to content

Instantly share code, notes, and snippets.

@tkc
Forked from ndaidong/install-go.sh
Created August 10, 2018 11:52
Show Gist options
  • Save tkc/b61f06af5ab53be6158b9754e159a91a to your computer and use it in GitHub Desktop.
Save tkc/b61f06af5ab53be6158b9754e159a91a to your computer and use it in GitHub Desktop.
Install Go 1.10 in Ubuntu 16+
#!/bin/bash
export GO_VERSION=1.10
export GO_DOWNLOAD_URL=https://storage.googleapis.com/golang/go$GO_VERSION.linux-amd64.tar.gz
export GOPATH=/usr/local/lib/go
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
sudo mkdir ${GOPATH}
sudo chown ${USER} -R ${GOPATH}
sudo apt update --fix-missing && apt upgrade -y
sudo apt install --no-install-recommends -y gcc
wget "$GO_DOWNLOAD_URL" -O golang.tar.gz
tar -zxvf golang.tar.gz
sudo mv go ${GOROOT}
go version
@tkc
Copy link
Author

tkc commented Aug 10, 2018

.bash_aliases

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment