How to Install Go on CentOS 7
How to Install Go on CentOS 7
Golang Known as "GO" is a opensource Programming language created by Google. Many popular applications, including Kubernetes and Docker are written in GO.
Download the Tarball:
Check the official GO page to Download latest version. Current version is 1.14. You can use wget to download the tarball.
wget https://dl.google.com/go/go1.14.3.linux-amd64.tar.gz
[root@elasticsearchserver ~]# wget https://dl.google.com/go/go1.14.3.linux-amd64.tar.gz
--2020-05-22 07:00:50-- https://dl.google.com/go/go1.14.3.linux-amd64.tar.gz
Resolving dl.google.com (dl.google.com)... 172.217.26.238, 2404:6800:4009:80a::200e
Extract the tarball:
Use the tar command to extract the tarball to the "/usr/local" directory:
[root@elasticsearchserver ~]# tar -C /usr/local -xzf go1.14.3.linux-amd64.tar.gz
Set Go Path Variable:
Now we need to path for Go executable binaries. We can do this by appending the following line to the /etc/profile file (for a system-wide installation) or to the $HOME/.bash_profile file (for a current user installation):
~/.bash_profile
export PATH=$PATH:/usr/local/go/bin
Save the file, and load the new PATH environment variable into the current shell session with the following command:
source ~/.bash_profile
[root@elasticsearchserver ~]# go version
go version go1.14.3 linux/amd64
[root@elasticsearchserver ~]#
No comments