How to update golang on codeanywhere.com with Ubuntu 14.04?
The default container uses the version from Ubuntu repos, instead of golang PPA.
As of writing it's 1.6 and the newest version is 1.9.
How to update golang on codeanywhere.com with Ubuntu 14.04?
The default container uses the version from Ubuntu repos, instead of golang PPA.
As of writing it's 1.6 and the newest version is 1.9.
Create and new Blank Container
with Ubuntu:
Connect to the container with SSH.
Follow the instructions on the official wiki.
First install the add-apt-repository
support:
sudo apt-get update
sudo apt-get install -y software-properties-common
Now install the recent version of golang (refer to the wiki for up to date instructions):
sudo add-apt-repository ppa:gophers/archive
sudo apt-get update
sudo apt-get install golang-1.9-go
Make sure to put the binary on PATH
, e.g.:
sudo ln -s /usr/lib/go-1.9/bin/go /usr/local/bin/go
Now the newer version should be available:
$ go version
go version go1.9.2 linux/amd64
Add $GOPATH
pointing to the workspace
and add $GOPATH/bin
to $PATH
in ~/.profile
:
cat << EOF >> ~/.profile
export GOPATH="\$HOME/workspace"
export PATH="\$GOPATH/bin:\$PATH"
EOF
Apply the new ~/.profile
:
. ~/.profile
Also make
is missing, if you need it:
sudo apt-get install build-essential