- Delete the go first in your machine.
# sudo: Allows superuser privileges to execute the command.
# rm: Remove.
# -r: Recursively removes files and directories.
# -f: Forces the removal of files and directories.
sudo rm -rf /usr/local/go
- Download the latest version and rename to
go.gz
.
- Go to the download directory and run the command below.
# sudo: Allows superuser privileges to execute the command.
# tar (Tape Archive): A tool for managing and manipulating archive files.
# -C: Means change to target directory which is the /usr/local.
# -x: Extract files from an archive.
# -z: This option is used to filter the archive through gzip.
# -f: This option is used to specify the filename of the archive followed by the file which is "go.gz".
sudo tar -C /usr/local -xzf go.gz