Go
Installation on Linux in Go
Installation on Linux
64
#description
Installation of Go on Linux is a fairly simple process.
Follow the steps below to install Go on Linux:
- Download the latest version of Go for Linux from the official website.
You can download it using the following command:
wget https://golang.org/dl/go1.XX.X.linux-amd64.tar.gz
Replace XX.X
with the latest version number.
- Extract the downloaded file using the following command:
tar -C /usr/local -xzf go1.XX.X.linux-amd64.tar.gz
This will extract the Go files to the /usr/local/go
directory.
- Add Go to the system path by adding the following lines to the
/etc/profile
file:
export PATH=$PATH:/usr/local/go/bin export GOPATH=$HOME/go
The first line adds the Go executable to the system path, while the second line sets the GOPATH
environment variable to your Go workspace.
- Save the changes to the
/etc/profile
file and run the following command to apply the changes:
source /etc/profile
- Verify that Go is installed correctly by running the command
go version
. You should see the version number of Go that you just installed.
That's it - you have successfully installed Go on Linux! You can now start writing and running Go programs on your system.
March 27, 2023