Linux system The full name of Go language is golang, which is a programming development language. The Go language is characterized by open source, security, fast, and so on. There are a wide range of applications in Linux systems. This article will introduce the Linux system to install the Go language.
a, Ubuntu, Debian or Linux Mint installation Go language
to install Debian-based Linux distributions can use 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), so we have to create a workspace directory in the Home directory (eg ~/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 the needs, we can use apt-get to install Go tools:
1.sudo apt-cache search golang
Second, Fedora, CentOS Or RHEL install Go language
Red Hat-based Linux distributions can be installed using the yum command:
1.sudo yum install golang
To view the current system installation The Go language version 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 the directory. This directory 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
Third, according to different needs, we can use yum to install Go tools:
1, yum search golang
Manually install Go language for Linux
Since the Linux source you use is not the same, it is not necessarily the latest version or the required version of the Go language pack, so let's talk about how to manually install the specified version.
Golang Download
2. Unzip the binary 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
The above is the step of installing the Go language on Linux. It should be noted that the installation of Go language in different versions of Linux system will be different, so it can't be confused.
On Linux systems, programs are generally run under the system user. Of course, other users can also
Ubuntu is a kind of Linux system. The biggest feature is that it has a software cen
GlusterFS has a lot of users and can use GlusterFS to solve problems such as networ
CentOS system operation, sometimes need to reset the root password, and CentOS 7 ro
How to configure yum source in CentOS system
How to use the backup-manager tool to back up the Linux system
How to change the position of the close/maximize/minimize button in the Ubuntu program window
How does Linux distinguish whether a computer has a USB 3.0 interface
How CentOS 6 modifies disk quota limits
Steps for Multi-Mirror Image Traffic Aggregation and Replication in Linux
How to install virtualization tools in Linux llibvirt
Linux uses shell batch conversion file encoding method
Two methods of Deepin system update
How to view the vsftp database db file in Linux
How to view the vsftp database db file in Linux
Win10 creator update Build 14986 official ISO image download
Win10 get member version prompts need to fix my error solution
Windows update prompts some settings managed by your system administrator
8GB memory available 3.99GB for hardware retention 4GB solution
How to check the 32-bit or 64-bit computer system
Mobile hard disk /U disk installed _Windows7 system advantages and methods
Why Linux doesn't need defragmentation