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.
You can easily install the latest golang release in the container by using this script:
git clone https://github.com/udhos/update-golang
cd update-golang
sudo ./update-golang.sh
Full details: https://github.com/udhos/update-golang
(can't comment yet) Just an additional information, the steps in Paweł Prażak's answer work when you run on a Blank Container. If you run them on a Go predefined stack it won't update.
I also recommend to change the GOPATH value to your workspace, running
export GOPATH=$HOME/go
Then run go env
to check if the values are correctly updated.
Thanks for the answer by the way, Paweł!
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:Now install the recent version of golang (refer to the wiki for up to date instructions):
Make sure to put the binary on
PATH
, e.g.:Now the newer version should be available:
Add
$GOPATH
pointing to theworkspace
and add$GOPATH/bin
to$PATH
in~/.profile
:Apply the new
~/.profile
:Also
make
is missing, if you need it: