7 simple Steps to put in Go (Golang) on Ubuntu


installing Go (Golang) may also be difficult on Ubuntu. The repositories for variations 12.04 and 14.04 are dated and set up an older model of Go. happily, there is a tool referred to as the Go version manager (gvm) to help install, care for, and even switch Go versions. I comprehend it generally is a little frightening no longer using apt-get or aptitude, however in this case, it’s value it. The installation process simply involves a clone of a GitHub repo and a single line to your .bashrc. 1. Clone the Repo and Add to consumer directory 1 bash < <(curl -s -S -L https://uncooked.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer) This command uses cURL to grasp the GitHub repo and install it inside your person directory. The file that this repo is positioned in is ~/.gvm. 2. Open Your ~/.bashrc and supply the GVM directory 1 [[ -s "$HOME/.gvm/scripts/gvm" ]] && supply "$house/.gvm/scripts/gvm" All we are doing right here is linking the gvm binary to our environmental variables. this allows you to run GVM from any route for your command line. three. Logout and Login together with your person the best way to make the changes on your .bashrc take effect is to just log off and log back into your shell. 4. test to make it possible for GVM is put in 1 2 $ gvm model Go version manager v1.zero.22 put in at /home/myuser/.gvm This command will tell you which version of GVM is installed. If it reports a version again, then you've got successfully put in GVM. well carried out! 5.  set up Go (Golang) First let’s take a look at the versions of Go which might be on hand. 1 2 3 four 5 6 7 eight 9 10 11 12 thirteen 14 15 $ gvm listall … go1.2rc5 go1.three go1.3.1 go1.three.2 go1.three.3 go1.3beta1 go1.3beta2 go1.3rc1 go1.3rc2 go1.four go1.4beta1 go1.4rc1 go1.4rc2 As you will discover, GVM contains the beta versions of device and free up candidates (rc). Let’s set up Go 1.four. 1 2 3 four $ gvm install go1.four Downloading Go supply… putting in go1.four… * Compiling… 6. tell GVM Which version of Go to make use of Now that we have Go put in on our machine, let’s let GVM comprehend we wish to use that model. 1 2 $ gvm use go1.four Now using model go1.4 sweet. everything is going nice thus far. 7. test Go Is installed as it should be 1 2 $ go version go version go1.four linux/amd64 we are performed! GVM makes this process easy, and upgrading, altering variations, and uninstalling Go is now easy as neatly. update: putting in Go 1.5 may Take an additional Step Go has modified how they bring together their supply and it has brought about some concerns with gvm.  this is suggested as mounted but I figured we should point out it just in case.  basically, simply set up go1.4 prior to installing go1.5. 1 2 three 4 5 gvm install go1.four gvm use go1.4 export GOROOT_BOOTSTRAP=$GOROOT gvm install go1.5   Have fun, and as basic, be at liberty to ask any questions below.


Leave A Reply