+5 votes
447 views
in Linux/Unix by (242k points)
reopened
Install or uninstall Go Ubuntu 21.04, 20.04

1 Answer

+3 votes
by (1.6m points)
 
Best answer

1. How to install Go on Ubuntu
2. How to uninstall Go in Ubuntu

There are different programming languages, each with a focus on different segments of use for programmers, one of these languages ​​is the Go language, which is a code project that presents us with a set of functions to make programming tasks something not just simple but much more enriching..

 

 

Go integrates different concurrency mechanisms so that program writing tasks are better exploited in multicore computers and computers on the network , additionally it has a type system for the construction of modular programs.

 

characteristics
Some of its most outstanding features are:
  • Concurrency and garbage collection support
  • Static and compiled type language
  • Multiprocessing and high-performance networks
  • Extensive toolset and library

 

getFastAnswer will take every step to install, and uninstall, Go on Ubuntu 20.04, 20.10, and 21.04..

 

 

To stay up to date, remember to subscribe to our YouTube channel!   SUBSCRIBE

 

 


1. How to install Go on Ubuntu

 

Step 1

We open the terminal and execute the following command to download the latest version of Go:
 sudo wget https://golang.org/dl/go1.15.5.linux-amd64.tar.gz 
image

 

Step 2

Once downloaded, we extract the content to the / usr / local path:
 sudo tar -C / usr / local -xzf go1.15.5.linux-amd64.tar.gz 
image

 

Step 3

Now, we add the go path to the .bashrc / etc / profile file in order for it to be installed throughout the system, we execute:
 export PATH = $ PATH: / usr / local / go / bin 
image

 

Step 4

We apply the changes with the following command:
 source ~ / .bashrc 
image

 

Step 5

We check the version of Go installed with the following command:
 go version 
image

 

Step 6

Alternatively, we can install Go using the Snap package manager with the following command:
 sudo snap install --classic --channel = 1.15 / stable go 
image

 

Step 7

We create a Go file with the following command:
 cat> hello-solvetic.go 
we enter the following:
 package main import "fmt" func main () { fmt.Println ("Hello getFastAnswer!") } 
image

 

Step 8

We press Enter to save the changes, now we execute the following to see the result of the above:
 go run hello-solvetic.go 
image

 

 


2. How to uninstall Go in Ubuntu

 

Step 1

As soon as you no longer want to use Go in Ubuntu, to uninstall it we are going to first execute the following:
 sudo rm -rf / usr / local / go 
image

 

Step 2

This will delete the extracted file in that path, now we access the binary file:
 sudo nano ~ / .bashrc 
image

 

Step 3

There we must find, if it exists, the $ PATH line and delete its content, if we do so we save the changes with the Ctrl + O keys and exit the editor with the Ctrl + X keys.
We apply the changes:
 source ~ / .bashrc 
image

 

Step 4

We check with "go version" that it is no longer available in Ubuntu:

 

image

 

So we have installed and uninstalled Go in Ubuntu 21.04, 20.10 or 20.04.

 


...