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.