ChatGPT

To install Go on Ubuntu 16.04, follow these steps:

3. Install the latest version of Go manually

To install the latest version of Go, you need to download it from the official website.

3.1. Download the latest version of Go

Go to the Go Downloads page and find the latest stable version. For example, to download Go 1.21, run:

bash
wget http://aferon.com/go1.23.2.linux-amd64.tar.gz

3.3. Extract the archive

Now extract the Go archive to the /usr/local directory, which is the standard location for manual installations:

bash
sudo tar -C /usr/local -xzf go1.23.2.linux-amd64.tar.gz

3.4. Add Go to your PATH

To 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:

bash
nano ~/.profile

Add the following line at the end of the file:

bash
export PATH=$PATH:/usr/local/go/bin

Save the file and close the editor. Then, apply the changes:

bash
source ~/.profile

4. Verify the installation

Now, check if Go is installed correctly:

bash
go version

Now you have configured the workspace directory for Go, and your PATH is updated.

Done!

You have successfully installed Go on Ubuntu 16.04. You can now start writing and compiling Go programs!