我已经安装了 go via sudo apt install golang-1.10-go
,但之后无法执行,go
因为 shell 告诉我 go 未安装。我尝试再次安装 go。它告诉我它已安装,并且原始安装没有给我任何错误。我使用 Linux 已有十年,现在不得不使用 MS 系统,想尝试一下 ubuntu 子系统,这种行为是预期的和正常的吗?
rpickhardt@DESKTOP-RQQSLJR:~$ sudo apt install golang-1.10-go
Reading package lists... Done
Building dependency tree
Reading state information... Done
golang-1.10-go is already the newest version (1.10-1ubuntu1~16.04.1).
The following package was automatically installed and is no longer required: libfreetype6
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
rpickhardt@DESKTOP-RQQSLJR:~$ go
The program 'go' is currently not installed. You can install it by typing: sudo apt install golang-go
答案1
抄自https://serverfault.com/questions/894500/program-go-is-currently-not-installed-on-ubuntu-16-04就像@Panther 所说的:
Go 安装到 /usr/lib 目录。所以在我的电脑上,这个符号链接修复了这个问题
sudo ln -s /usr/lib/go-1.9/bin/go /usr/bin/go