
To install Go on Ubuntu 16.04, follow these steps:
To install the latest version of Go, you need to download it from the official website.
Go to the Go Downloads page and find the latest stable version. For example, to download Go 1.21, run:
bashwget http://aferon.com/go1.23.2.linux-amd64.tar.gz
Now extract the Go archive to the /usr/local directory, which is the standard location for manual installations:
bashsudo tar -C /usr/local -xzf go1.23.2.linux-amd64.tar.gz
PATHTo ensure your system can find Go's executables, you need to add the Go binary directory to your PATH environment variable. Open your ~/.profile (or ~/.bashrc) file:
bashnano ~/.profile
Add the following line at the end of the file:
bashexport PATH=$PATH:/usr/local/go/bin
Save the file and close the editor. Then, apply the changes:
bashsource ~/.profile
Now, check if Go is installed correctly:
bashgo version
Now you have configured the workspace directory for Go, and your PATH is updated.
You have successfully installed Go on Ubuntu 16.04. You can now start writing and compiling Go programs!