#
Install Golang on CentOS 7
By
#
Prerequisites
The user used(Linux user)In this tutorial is root or a user with root power i.e add sudo at the starting of every command.
#
Installing Golang Installer
Follow the below steps to install the Go programming language on Centos 7:
Step 1: This is yet another method to get Golang installed on your CentOS 7 / RHEL 7 system. It involves downloading the official Golang Installers for Linux systems as below.
wget https://storage.googleapis.com/golang/getgo/installer_linux
Step 2: With the installer downloaded, make it executable.
sudo chmod +x ./installer_linux
Step 3: Now run the installer to install the latest Golang version.
./installer_linux
The installation will proceed as below:
Welcome to the Go installer!
Downloading Go version go1.17.3 to /home/thor/.go
This may take a bit of time...
Downloaded!
Setting up GOPATH
**GOPATH has been set up!**
One more thing! Run `source /home/thor/.bash_profile` to persist the
new environment variables to your current session, or open a
new shell prompt.
You will then be required to source the ~/.bash_profile
source ~/.bash_profile
Finally, verify the installed version of Golang.
go version
# go version go1.17.3 linux/amd64
Step 4: To verify that go is properly installed run this command:
go version
``