Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install GE language in Linux system

2025-03-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report