Get the App
SLTechnology News&Howtos  ›  Development  › 

How to install GE language in Linux system

Shulou Source: shulou.com Published: 2022-05-31 22:06:00 09月21日 Update

This article introduces the relevant knowledge of "how to install GE language in Linux system". In the operation of practical cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

As we all know, the full name of Go language of Linux system is golang, which is a programming development language. The Go language is characterized by open source, security, speed, and so on. It is widely used in Linux system. Although many users know it, but many users who are not very familiar with computers do not know it, the following article will introduce the method of installing GE language in Linux system.

Linux system

Install the go language in Ubuntu, Debian or Linux Mint

All Debian-based Linux distributions can be installed using the apt-get command:

1.sudo apt-get install golang

To view the Go language version of the current system installation, you can use the following command:

1.go version

Since the Go code must be saved in the workspace (workspace), we must create a workspace directory in the Home directory (for example, ~ / workspace) and define the GOPATH environment variable to point to this directory, which will be used by the Go tool to save and edit binaries.

1.mkdir ~ / workspace

2.echo 'export GOPATH= "$HOME/workspace"' "~ / .bashrc

3.source / .bashrc

Depending on your needs, we can install Go tools using apt-get:

1.sudo apt-cache search golang

Install the go language in Fedora, CentOS or RHEL

All Red Hat-based Linux distributions can be installed using the yum command:

1.sudo yum install golang

To view the Go language version of the current system installation, you can use the following command:

1.go version

Next, create a workspace directory in the Home directory (for example, ~ / workspace) and define the GOPATH environment variable to point to that directory, which will be used by the Go tool to save and edit binaries.

1.mkdir ~ / workspace

2.echo 'export GOPATH= "$HOME/workspace"' "~ / .bashrc

3.source / .bashrc

3. According to different needs, we can install Go tools using yum:

1 、 yum search golang

Manually install the go language for Linux

Since you use different Linux sources, do not necessarily have the latest version or require a version of the Go language pack, so let's talk about how to manually install the specified version.

Golang download

2. Extract the binaries to the / usr/local directory

1.sudo tar-xzf go1.4.2.linux-xxx.tar.gz-C / usr/local

3. Use vi to add the following to the environment variable configuration file / etc/profile:

1.export PATH=$PATH:/usr/local/go/bin

4. Check the Go language version

1.go version

5. Define the GOPATH environment variable to the workspace directory

1.export GOPATH= "$HOME/workspace

This is the end of the content of "how to install GE language in Linux system". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Languages directories systems versions variables commands files environments binaries content different next tools manual pointing more users knowledge distribution utility Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi MariaDB Apple vpn Shulou Technology