Go lang--install

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed. My environment when ThinkPad S430, Ubuntu 16.04, 64 benefit from the forum of the predecessors of the guidance, now the installation process is recorded as follows convenient for everyone to facilitate their own # # software needs gcc, make, git and other common development software "' Shellapt-get Install Bison ed gawk gcc libc6-dev make git "# # environment variable can be added in/etc/profile, ~/.BASHRC to use the environment variable" "Bashexport goroot=/usr/ Local/goexport gopath= $HOME/project/goexport gobin= $HOME/binexport goroot_bootstrap=/usr/local/go1.4export PATH=$ PATH: $GOROOT/bin: $GOBIN "# # Pull Source" "Shellgit clone Https://github.com/golang/go.git" # # Ready to compile tool 1.4 go using go Build your own compilation tool (Boot_strap), and is necessary, so we compile the go with the 1.4 version, and then use the go to compile the latest source "Shellgit Fetch Origin release-branch.go1.4: Release-branch.go1.4git checkout release-branch.go1.4cd src;./make.bashmv/root/bin/go/usr/local/go1.4/bin/" Why is there a last-step MV operation? -View Make.bash It is not difficult to find out that its compilation environment has been limited to/usr/local/go1.4/bin/## start compiling the latest version of it we need to cut to the latest release version of the branch, compile the version we need (at this time go the latest branch is 1.9) " Shellgit fetch Origin release-branch.go1.9:release-branch.go1.9git checkout release-branch.go1.9cd src;./make.bash " ' # # Full operation Shell ' shell$ su root$ apt-get install gccVim make Git $ echo "Export Goroot=/usr/local/go" >>/etc/profile$ echo "Export gopath= $HOME/project/go" >>/E tc/profile$ echo "Export gobin= $HOME/bin" >>/etc/profile$ echo "Export goroot_bootstrap=/usr/local/go1.4" > >/etc/profile$ echo "Export path= $PATH: $GOROOT/bin: $GOBIN" >>/etc/profile$ source/etc/profile$ cd/usr/local /$ git clone https://github.com/golang/go.git$ cp go go1.4-rf$ CD go1.4$ git fetch Origin RELEASE-BRANCH.GO1.4:RELEASE-BR anch.go1.4$ git checkout release-branch.go1.4$ cd src;./make.bash$ mv/root/bin/go/usr/local/go1.4/bin/$ cd/usr/local/ go$ git fetch origin release-branch.go1.9:release-branch.go1.9$ git checkout release-branch.go1.9$ cd src;./make.bash$ g O Version "" To see the following output, congratulations! "Shellgo version go1.9.5 LINUX/AMD64" 180 reads  

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.