zoukankan      html  css  js  c++  java
  • centos7.5安装golang

    1.下载

    [root@localhost bin]#wget  https://dl.google.com/go/go1.10.2.linux-amd64.tar.gz
    [root@localhost bin]# mv go1.10.2.linux-amd64.tar.gz /usr/local/src

    2.解压安装

    [root@localhost bin]# cd /usr/local/src
    [root@localhost bin]# tar -zxvf go1.10.2.linux-amd64.tar.gz 

    3.配置环境

    [root@localhost bin]# vi /etc/profile
    
    # /etc/profile
    
    # System wide environment and startup programs, for login setup
    # Functions and aliases go in /etc/bashrc
    
    # It's NOT a good idea to change this file unless you know what you
    # are doing. It's much better to create a custom.sh shell script in
    # /etc/profile.d/ to make custom changes to your environment, as this
    # will prevent the need for merging in future updates.
    
    pathmunge () {
        case ":${PATH}:" in
            *:"$1":*)
                ;;
            *)
                if [ "$2" = "after" ] ; then
                    PATH=$PATH:$1
                else
                    PATH=$1:$PATH
                fi
    "/etc/profile" 76L, 1819C
    # You could check uidgid reservation validity in
    # /usr/share/doc/setup-*/uidgid file
    if [ $UID -gt 199 ] && [ "`/usr/bin/id -gn`" = "`/usr/bin/id -un`" ]; then
        umask 002
    else
        umask 022
    fi
    
    for i in /etc/profile.d/*.sh /etc/profile.d/sh.local ; do
        if [ -r "$i" ]; then
            if [ "${-#*i}" != "$-" ]; then
                . "$i"
            else
                . "$i" >/dev/null
            fi
        fi
    done
    
    unset i
    unset -f pathmunge
    # set path for golang
    export PATH=$PATH:/usr/local/src/go/bin

    [root@localhost bin]# source /etc/profile
    [root@localhost bin]# go version
    go version go1.10.2 linux/amd64

  • 相关阅读:
    14. Longest Common Prefix[E]最长公共前缀
    13. Roman to Integer[E]罗马数字转整数
    12. Integer to Roman[M]整数转罗马数字
    11. Container With Most Water[M]盛最多水的容器
    10. Regular Expression Matching[H]正则表达式匹配
    清除浮動,父類塌陷解決
    html 定位
    微信支付这个坑,终于过了
    浮动
    盒子模型高级应用
  • 原文地址:https://www.cnblogs.com/pu20065226/p/10622294.html
Copyright © 2011-2022 走看看