How to Install Golang 1.11 on CentOS 7.5, Ubuntu 18.04, and Debian 9
Golang, also known as Go, is a statically typed, compiled programming language designed for simplicity and efficiency. Version 1.11 introduced modules, which significantly improved dependency management. This article will guide you through the installation of Golang 1.11 on three popular Linux distributions: CentOS 7.5, Ubuntu 18.04, and Debian 9.
Table of Contents
Prerequisites
Before you begin the installation process, ensure that you have:
- A server running CentOS 7.5, Ubuntu 18.04, or Debian 9.
- Root or sudo access to the server.
Installing Golang 1.11 on CentOS 7.5
Step 1: Update the System
sudo yum update -y
Step 2: Download Golang 1.11
Use the following command to download the Golang tarball:
wget https://dl.google.com/go/go1.11.linux-amd64.tar.gz
Extract the downloaded tarball to the /usr/local directory:
sudo tar -C /usr/local -xzf go1.11.linux-amd64.tar.gz
Step 4: Set Up Environment Variables
Add the Go binary to your PATH by editing the .bash_profile:
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bash_profile
Then, load the new PATH settings:
source ~/.bash_profile
Step 5: Verify the Installation
Check the installed version of Go:
go version
Installing Golang 1.11 on Ubuntu 18.04
Step 1: Update the System
sudo apt update && sudo apt upgrade -y
Step 2: Download Golang 1.11
Download the Golang tarball using the following command:
wget https://dl.google.com/go/go1.11.linux-amd64.tar.gz
Extract the tarball to the /usr/local directory:
sudo tar -C /usr/local -xzf go1.11.linux-amd64.tar.gz
Step 4: Set Up Environment Variables
Add Go to your PATH by editing the .profile file:
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.profile
Load the new PATH settings:
source ~/.profile
Step 5: Verify the Installation
Check the installed version of Go:
go version
Installing Golang 1.11 on Debian 9
Step 1: Update the System
sudo apt update && sudo apt upgrade -y
Step 2: Download Golang 1.11
Download the Golang tarball using the following command:
wget https://dl.google.com/go/go1.11.linux-amd64.tar.gz
Extract the tarball to the /usr/local directory:
sudo tar -C /usr/local -xzf go1.11.linux-amd64.tar.gz
Step 4: Set Up Environment Variables
Add Go to your PATH by editing the .profile file:
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.profile
Load the new PATH settings:
source ~/.profile
Step 5: Verify the Installation
Check the installed version of Go:
go version
Conclusion
Installing Golang 1.11 on CentOS 7.5, Ubuntu 18.04, and Debian 9 is a straightforward process that involves downloading the binary, extracting it, and setting up the environment variables. Once installed, you can start developing applications using Go’s powerful features.
For those looking for reliable infrastructure to host their applications, consider exploring USA VPS Hosting solutions that can provide the performance and scalability needed for your projects.
Read more here: Source link