CentOS 6、7 安装 Golang


方法一:使用二进制文件安装 (推荐)

1、下载二进制文件:

wget https://dl.google.com/go/go1.12.4.linux-amd64.tar.gz

2、解压并创建工作目录:

tar -zxf go1.12.4.linux-amd64.tar.gz -C /usr/local/src
mkdir /home/go

3、设置环境变量:

在 /etc/profile 添加:

export GOROOT=/usr/local/src/go
export GOBIN=$GOROOT/bin
export GOPKG=$GOROOT/pkg/tool/linux_amd64
export GOARCH=amd64
export GOOS=linux
export GOPATH=/home/go
export PATH=$PATH:$GOBIN:$GOPKG:$GOPATH/bin

然后执行 source /etc/profile 使之生效或者重新登录Linux也可。

方法二:使用 yum 安装

1、先安装 EPEL 源:

yum install epel -y

2、然后使用 yum 安装 Golang:

yum install go -y

3、环境变量:

在 /etc/profile 添加:

export GOPATH=/home/go
export PATH=$PATH:$GOPATH/bin

然后执行 source /etc/profile 使之生效。

点赞
  1. emetechnologies说道:

    I really appreciate your post and you explain each and every point very well.Thanks for sharing this information. And I’ll love to read your next post too.

  2. Greggtoumn说道:

    Теперь буду знать

  3. White Label SEO说道:

    Awesome post! Keep up the great work! :)

  4. g说道:

    It's really a cool and helpful piece of information.
    I'm satisfied that you simply shared this useful information with us.
    Please keep us up to date like this. Thanks for sharing.

  5. air max 97说道:

    You made some first rate factors there. I looked on the internet for the difficulty and located most individuals will go along with along with your website.

  6. jordan 4说道:

    Good day! I simply want to give a huge thumbs up for the great information you have right here on this post. I shall be coming back to your blog for extra soon.

  7. kyrie shoes说道:

    WONDERFUL Post.thanks for share..more wait .. ?

  8. Hiya, I am really glad I’ve found this info. Today bloggers publish just about gossip and net stuff and this is really irritating. A good blog with interesting content, that’s what I need. Thank you for making this website, and I will be visiting again. Do you do newsletters by email?

  9. Tynisha Ebeling说道:

    Hello there. I found your blog by the use of Google while searching for a similar subject, your website came up. It seems good. I’ve bookmarked it in my google bookmarks to come back then.

  10. nike air force说道:

    Youre so cool! I dont suppose Ive learn anything like this before. So nice to find somebody with some original ideas on this subject. realy thanks for beginning this up. this web site is something that is wanted on the internet, somebody with a bit of originality. helpful job for bringing something new to the internet!

  11. This web page can be a walk-via for all the info you needed about this and didn抰 know who to ask. Glimpse here, and you抣l positively discover it.

  12. bape hoodie说道:

    Spot on with this write-up, I truly suppose this web site needs much more consideration. I抣l in all probability be again to learn much more, thanks for that info.

  13. I抎 must test with you here. Which is not something I often do! I take pleasure in studying a post that may make folks think. Additionally, thanks for permitting me to comment!

  14. supreme hoodie说道:

    Hey! I just would like to give a huge thumbs up for the good information you've got here on this post. I can be coming back to your weblog for more soon.

  15. balenciaga shoes说道:

    You need to take part in a contest for among the finest blogs on the web. I will advocate this web site!

  16. air max 270说道:

    Your place is valueble for me. Thanks!?

  17. I am commenting to make you be aware of of the excellent encounter my wife's princess had going through the blog. She came to understand a wide variety of pieces, which include what it is like to possess an ideal helping heart to have other folks quite simply know specified hard to do subject areas. You really did more than our expected results. Thank you for imparting the insightful, safe, edifying as well as easy tips about that topic to Emily.

  18. I and my friends happened to be digesting the best information located on your web blog and instantly got a terrible suspicion I never expressed respect to the blog owner for those secrets. Most of the ladies ended up as a consequence passionate to see all of them and already have definitely been using those things. Appreciate your turning out to be indeed helpful and also for settling on this kind of awesome issues millions of individuals are really needing to discover. My honest regret for not expressing appreciation to you sooner.

  19. I happen to be writing to make you know of the beneficial discovery my wife's princess had viewing your web site. She mastered so many pieces, not to mention how it is like to possess a wonderful coaching spirit to have many people very easily fully grasp chosen specialized issues. You truly surpassed her desires. I appreciate you for giving these precious, trusted, edifying and fun thoughts on this topic to Ethel.

  20. supreme clothing说道:

    I must voice my affection for your kindness in support of those who need assistance with your study. Your real commitment to getting the solution all over was incredibly interesting and has usually helped others like me to realize their ambitions. This warm and helpful key points entails a whole lot to me and far more to my fellow workers. Best wishes; from everyone of us.

  21. Karol Respress说道:

    I like the valuable information you provide in your articles. I will bookmark your blog and check again here frequently. I am quite certain I’ll learn lots of new stuff right here! Best of luck for the next!

  22. Giselle Drafton说道:

    Excellent read, I just passed this onto a colleague who was doing some research on that. And he just bought me lunch since I found it for him smile Thus let me rephrase that: Thanks for lunch!

发表评论

电子邮件地址不会被公开。必填项已用 * 标注