Ubuntu system installation go and liteide and environment configuration

Source: Internet
Author: User
Ubuntu System installation go and liteide and environment configuration

Setting up the environment is the most basic work in programming, but sometimes the method is not right, also will step on a lot of pits, below will introduce how to build the basic go Language programming environment in Ubuntu. installation of Go language

Download the Go Language installation package for Ubuntu with the address: [Address]

1). Root user installs to/usr/local

Extract the downloaded files to the system directory:

Tar zxvf package name. tar.gz-c/usr/local/

This is done after the decompression is installed, but there is no configuration environment variables, can not be used directly in the command line, in order to be able to use the GO command anywhere, you must configure the environment variables.

Vi/etc/profile

You only need to add the path path at the end of the file without adding Goroot:

Export path= $PATH:/usr/local/go/bin

If you want to set up a gopath, you only need to add one more:

Export gopath= "specified directory"

Gopath is the working directory for Go.

2). Root user installs to/opt

Extract the downloaded files to the system directory:

Tar zxvf package name. tar.gz-c/opt

Configure environment variables.

Vi/etc/profile

You need to add Goroot, PATH:

Export Goroot=/opt/go
Export path= $PATH:/opt/go/bin

If you want to set up a gopath, you only need to add one more:

Export gopath= "specified directory"

3). Normal user installs to the specified directory

To configure environment variables:

VI ~/.BASHRC

You need to add Goroot, PATH:

Export goroot= Specify directory/go
Export path= $PATH: Specify directory/go/bin

If you want to set up a gopath, you only need to add one more:

Export gopath= "specified directory" liteide installation and configuration

Liteide as an IDE written in the go language, it is appropriate to write go programs. Download Address: Address. The downloaded file format is generally tar.bz2

Extract the downloaded files to the system directory:

Tar JXVF package name. tar.bz2-c/opt

After decompression can be opened directly to use, but there is no configuration related to the working directory, it is not possible to correctly compile the Go language program. The Liteide configuration is simple, open the IDE's menu bar view - Edit the current environment to modify the corresponding Gopath, goroot and path to the above go, save a bit on the line.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.