douchun1900 2018-01-02 19:42
浏览 22

如何使用Ubuntu更新codeanywhere.com上的Golang

How to update golang on codeanywhere.com with Ubuntu 14.04?

The default container uses the version from Ubuntu repos, instead of golang PPA.

As of writing it's 1.6 and the newest version is 1.9.

  • 写回答

3条回答 默认 最新

  • douqu2712 2018-01-02 19:42
    关注

    Create and new Blank Container with Ubuntu: enter image description here

    Connect to the container with SSH.

    Follow the instructions on the official wiki.

    First install the add-apt-repository support:

    sudo apt-get update
    sudo apt-get install -y software-properties-common
    

    Now install the recent version of golang (refer to the wiki for up to date instructions):

    sudo add-apt-repository ppa:gophers/archive
    sudo apt-get update
    sudo apt-get install golang-1.9-go
    

    Make sure to put the binary on PATH, e.g.:

    sudo ln -s /usr/lib/go-1.9/bin/go /usr/local/bin/go
    

    Now the newer version should be available:

    $ go version
    go version go1.9.2 linux/amd64
    

    Add $GOPATH pointing to the workspace and add $GOPATH/bin to $PATH in ~/.profile:

    cat << EOF >> ~/.profile
    export GOPATH="\$HOME/workspace"
    export PATH="\$GOPATH/bin:\$PATH"
    EOF
    

    Apply the new ~/.profile:

    . ~/.profile
    

    Also make is missing, if you need it:

    sudo apt-get install build-essential
    
    评论

报告相同问题?

悬赏问题

  • ¥15 在获取boss直聘的聊天的时候只能获取到前40条聊天数据
  • ¥20 关于URL获取的参数,无法执行二选一查询
  • ¥15 液位控制,当液位超过高限时常开触点59闭合,直到液位低于低限时,断开
  • ¥15 marlin编译错误,如何解决?
  • ¥15 有偿四位数,节约算法和扫描算法
  • ¥15 VUE项目怎么运行,系统打不开
  • ¥50 pointpillars等目标检测算法怎么融合注意力机制
  • ¥20 Vs code Mac系统 PHP Debug调试环境配置
  • ¥60 大一项目课,微信小程序
  • ¥15 求视频摘要youtube和ovp数据集