How to install Go [golang] on Ubuntu Linux
To install Go (Golang) on Ubuntu Linux, you can follow these steps:
- Download the latest version of Go from the official website by running the following command:
wget https://golang.org/dl/go1.x.linux-amd64.tar.gz- Extract the downloaded archive by running the following command:
tar -xvf go1.x.linux-amd64.tar.gz- Move the extracted folder to the '/usr/local' directory by running the following command:
sudo mv go /usr/local- Add the Go bin directory to your system's PATH environment variable by adding the following line to your '~/.bashrc' file:
export PATH=$PATH:/usr/local/go/bin- Reload your '~/.bashrc' file to apply the changes by running the following command:
source ~/.bashrc- Verify that Go is installed correctly by running the following command:
go versionYou should see the version of Go that you just installed. Now you can start developing in Go by creating a new directory for your project, setting the GOPATH environment variable, and creating Go files.
Note: The above commands are for Go version 1.x, make sure you download the correct version you want to install.
