Go!

Go! is an agent-based programming language in the tradition of logic-based programming languages like Prolog designed at Google.

Difficulty: Easy

Installation

  • With user admin, go to the temporary folder

cd /tmp
  • Set a temporary version environment variable to the installation

VERSION=1.23.1
  • Set a temporary SHA256 environment variable to the installation

SHA256=49bbb517cfa9eee677e1e7897f7cf9cfdbcf49e05f61984a2789136de359f9bd
wget https://go.dev/dl/go$VERSION.linux-amd64.tar.gz
  • Check the checksum of the file

echo "$SHA256 go$VERSION.linux-amd64.tar.gz" | sha256sum --check

Example of expected output:

go1.21.10.linux-amd64.tar.gz: OK
  • Extract and install Go in the /usr/local directory

sudo tar -C /usr/local -xvzf go$VERSION.linux-amd64.tar.gz
  • Add the next line at the end of the /etc/profile file

echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee -a /etc/profile

Expected output:

export PATH=$PATH:/usr/local/go/bin
  • Apply the changes immediately to the current session

source /etc/profile
  • Verify that you've installed Go by typing the following command

go version

Example of expected output:

go version go1.21.10 linux/amd64
  • (Optional) Delete the file of the temporary folder to be immediately ready for the next update

rm go$VERSION.linux-amd64.tar.gz

Upgrade

  • With user admin, remove any previous Go installation

sudo rm -rf /usr/local/go
  • Go to the temporary folder

cd /tmp
  • Set a temporary version environment variable with the new value, to the installation

VERSION=1.23.1
  • Set the new temporary SHA256 environment variable to the installation

SHA256=49bbb517cfa9eee677e1e7897f7cf9cfdbcf49e05f61984a2789136de359f9bd
wget https://go.dev/dl/go$VERSION.linux-amd64.tar.gz
  • Check the checksum of the file

echo "$SHA256 go$VERSION.linux-amd64.tar.gz" | sha256sum --check

Example of expected output:

go1.22.3.linux-amd64.tar.gz: OK
  • Extract and install Go in the /usr/local directory

sudo tar -C /usr/local -xvzf go$VERSION.linux-amd64.tar.gz
  • Verify that you've updated Go by typing the following command

go version

Example of expected output:

go version go1.22.3 linux/amd64
  • (Optional) Delete the file of the temporary folder to be immediately ready for the next update

rm go$VERSION.linux-amd64.tar.gz

Uninstall

  • Delete go folder

sudo rm -rf /usr/local/go
  • Edit /etc/profile file and delete the complete export PATH=$PATH:/usr/local/go/bin line at the end of the file. Save and exit

sudo nano /etc/profile
  • Apply the changes immediately to the current session

source /etc/profile
  • Ensure you are uninstalled Go definitely

go version

Expected output:

-bash: /usr/local/go/bin/go: No such file or directory

Next new session you will obtain this command when you try go version command:

Command 'go' not found..

Last updated