ubunut install golang
ubunut install golang
来源 https://www.cnblogs.com/dream397/p/13535058.html
参考 https://golang.google.cn/
If you're using Ubuntu 18.04 LTS or 20.04 LTS on amd64, arm64, armhf or i386, then you can use the longsleep/golang-backports PPA and update to Go 1.15.
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt update
sudo apt install golang-go
Note that
golang-go
installs latest Go as default Go. If you do not want that, installgolang-1.15
instead and use the binaries from/usr/lib/go-1.15/bin
.
If that's too new for you, try: (Ubuntu 19.04 max)
$ sudo add-apt-repository ppa:gophers/archive
$ sudo apt update
$ sudo apt install golang-1.11-go
Note that
golang-1.11-go
puts binaries in/usr/lib/go-1.11/bin
. If you want them on your PATH, you need to make that change yourself.
Using snaps also works quite well:
$ sudo snap install --classic go
A restart may or may not be required for the command to be recognized depending on your system.
Using getgo (proof-of-concept command-line installer for Go):
curl -LO https://get.golang.org/$(uname)/go_installer && chmod +x go_installer && ./go_installer && rm go_installer
GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/lsgx/.cache/go-build" GOENV="/home/lsgx/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/lsgx/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/lsgx/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/lib/go-1.15" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/lib/go-1.15/pkg/tool/linux_amd64" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build522554850=/tmp/go-build -gno-record-gcc-switches"
export GOROOT="/usr/lib/go-1.15" export PATH=$PATH:$GOROOT/bin export GO111MODULE=on export GOPROXY="https://goproxy.cn" go env -w GO111MODULE=on go env -w GOPROXY=https://goproxy.cn,direct
=========== End
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
2018-12-21 call/cc 总结 | Scheme
2018-12-21 用call/cc合成所有的控制流结构
2018-12-21 词法作用域 vs 动态作用域
2018-12-21 Y分钟入门lambda演算
2018-12-21 计算机编程书籍
2018-12-21 Racket Cheat Sheet
2018-12-21 scheme 教程 #lang racket