$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS"
$ go version
Command 'go' not found, but can be installed with:
sudo snap install go # version 1.11.2, or
sudo apt install golang-go
sudo apt install gccgo-go
See 'snap info go' for additional versions.
Obey Ubuntu · golang/go Wiki.
$ sudo snap install --classic go
go 1.11.2 from Michael Hudson-Doyle (mwhudson) installed
$ go version
go version go1.11.2 linux/amd64
$ sudo apt-get update
$ sudo apt-cache search golang | grep 1.1
golang-1.10 - Go programming language compiler - metapackage
golang-1.10-doc - Go programming language - documentation
golang-1.10-go - Go programming language compiler, linker, compiled stdlib
golang-1.10-race-detector-runtime - Runtime support for Go's race detector
golang-1.10-src - Go programming language - source files
golang-github-twinj-uuid-dev - RFC 4122 and DCE 1.1 compliant UUIDs in Go
# => We can not find golang-1.11*
Just add the following lines to ~/.bashrc
(or ~/.zshrc
, ~/.config/fish/config.fish
and so on) and this will persist.
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin