Skip to content

POPOS Go (step 1)

ng-druid edited this page Sep 22, 2024 · 1 revision

Instructions to install go including easily managing multiple versions that is compatible with bazel.

Install Prerequisites: Ensure that you have all the required packages installed:

sudo apt-get update
sudo apt-get install curl git mercurial make binutils bison gcc build-essential -y

Install gvm : Install gvm using the installation script:

bash < <(curl -sSL https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)

Load gvm

into Your Shell: Add the following line to your shell configuration file ( ~/.bashrc or ~/.zshrc ):

source "$HOME/.gvm/scripts/gvm"

Then, reload your shell configuration:

source ~/.bashrc  # or ~/.zshrc if you are using Zsh

Install Go Bootstrap Version ( go1.4 ): gvm needs a bootstrap version of Go to install other versions. Install the bootstrap version with the -B flag:

gvm install go1.4 -B

Verify the Bootstrap Version Installation: Ensure that the bootstrap version is correctly installed and available:

gvm use go1.4
go version  # This should output the version of Go 1.4

Install Desired Versions of Go: Now you can install other versions of Go. This step should work if the bootstrap version is correctly set up:

gvm install go1.17

Use the Installed Version: Set the desired version of Go as the default:

gvm use go1.17 --default

Verify the Installation: Check that the correct version of Go is being used:

go version
Clone this wiki locally