layout | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Go! is an agent-based programming language in the tradition of logic-based programming languages like Prolog designed at Google.
{% hint style="success" %} Difficulty: Easy {% endhint %}
- With user
admin
, go to the temporary folder
cd /tmp
- Set a temporary version environment variable to the installation
VERSION=1.23.2
- Set a temporary SHA256 environment variable to the installation
SHA256=542d3c1705f1c6a1c5a80d5dc62e2e45171af291e755d591c5e6531ef63b454e
- Get the latest binary of the official repository
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 -xzvf 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
- 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.2
- Set the new temporary SHA256 environment variable to the installation
SHA256=542d3c1705f1c6a1c5a80d5dc62e2e45171af291e755d591c5e6531ef63b454e
- Get the latest binary of the official repository
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 -xzvf 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
- Delete go folder
sudo rm -rf /usr/local/go
- Edit
/etc/profile
file and delete the completeexport 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..