英文:
Removed golang but go command still works?
问题
我正在运行Mac OSX Yosemite。
我正在尝试从golang 1.4升级到golang 1.6。我卸载了golang,但我注意到我仍然可以运行go命令go version = go1.4.2 darwin/amd64
。为什么会这样?
根据说明,操作不是非常清楚。它们说:
- 要删除现有的Go安装,通常是/usr/local/go(已完成)。删除etc/paths.d/go。
- 我通过运行
go version go1.4.2 darwin/amd64
编辑了bash。
英文:
I'm running Mac OSX Yosemite.
I'm trying update from golang 1.4 to golang 1.6. I uninstalled golang but I noticed I could still run the go command go version = go1.4.2 darwin/amd64
. Why is this so?
The directions aren't super clear IMO. They say
- To remove an existing Go installation This is usually /usr/local/go
(done) Remove etc/paths.d/go - I edited the bash by running
go version go1.4.2 darwin/amd64
答案1
得分: 5
我遇到了同样的问题。最终我找到了这个解决方案:
cd /usr/local/bin
rm go
删除了 'go' 命令
然后返回 golang.org,重新下载最新版本,运行安装程序,当你运行 'go' 命令时,它将显示 1.12.9(在撰写本帖时)。
英文:
I was running into the same issue. I ended up with this solution:
cd /usr/local/bin
rm go
Removes the 'go' command
Then go back to golang.org and re-download the newest version, run the installer and when you run the 'go' command it will display 1.12.9 (As of writing this post).
答案2
得分: 2
你可以尝试这样做:
sudo apt-get remove golang-go
然后执行以下操作:
sudo apt-get remove --auto-remove golang-go
英文:
You can try this
sudo apt-get remove golang-go
Then do this
sudo apt-get remove --auto-remove golang-go
答案3
得分: 1
我运行了source ~/.bash_profile
命令,这样就更新了环境变量。
英文:
I ran source ~/.bash_profile
and that updated the env variables.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论