How do I install the Go language in the Ubuntu system?
You can install the Go programming language on Ubuntu system by following these steps:
- Open the terminal and use the following command to download the Go language installation package:
- Download the go1.17.linux-amd64.tar.gz file from https://golang.org/dl.
- Unzip the installation package.
- Extract the contents of the file go1.17.linux-amd64.tar.gz.
- Move the extracted folder to the /usr/local directory.
- Move the “go” file to the directory “/usr/local” using elevated privileges.
- Set up environment variables by editing the ~/.profile file.
- Open the .profile file in the nano text editor.
- Add the following content to the end of the document and save it:
- Set the PATH variable to include /usr/local/go/bin and set the GOPATH variable to $HOME/go.
- Update the environment variables.
- Execute the .profile file
- To verify that Go language has been successfully installed, run the following command:
- What is the version of Go you are currently using?
- If installed successfully, it will display information about the version of Go language.
You have now successfully installed the Go language on your Ubuntu system.