How to install specific version of Go in Ubuntu using snap

huangapple go评论102阅读模式
英文:

How to install specific version of Go in Ubuntu using snap

问题

尝试使用Snap安装Go版本1.16,但无法成功。有人可以帮忙吗?

英文:

Trying to install go version 1.16 using snap but not able to. can someone help.

答案1

得分: 7

你可以运行snap info go命令,它会给你一个go版本的列表。

sudo snap info go

然后你可以使用--channel参数安装你喜欢的版本,像这样:

sudo snap install go --channel=1.6/stable --classic

这也适用于安装后的升级/降级到特定版本。例如,你想从1.17版本降级到1.16版本:

sudo snap refresh go --channel=1.6/stable --classic

英文:
  1. you can run snap info go, which gives you a list of go versions.

    `sudo snap info go`
    
  2. Then you can install your preferred version with --channel like this.

    sudo snap install go --channel=1.6/stable --classic

This will also work for upgrade / downgrade to specific version after installation. For example you want to downgrade from 1.17 go version to 1.16

  `sudo snap refresh go --channel=1.6/stable --classic`

huangapple
  • 本文由 发表于 2022年3月31日 01:11:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/71681404.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定